开发者

Issue with rake & mysql2 gem

Newbie to rails here. I'm running Snow Leopard with 10.6.4 with rails (3.0.7), mysql2 (0.3.2) gem & mysql-5.5.12 (64 bit version). My problem is that rake wont dump DB Schema into my rails project. The error it gives:

Homes-Mac-Pro:demo home$ rake db:sche开发者_开发百科ma:dump
(in /Users/home/Sites/demo)
rake aborted!
dlopen(/Library/Ruby/Gems/1.8/gems/mysql2-0.3.2/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib
  Referenced from: /Library/Ruby/Gems/1.8/gems/mysql2-0.3.2/lib/mysql2/mysql2.bundle
  Reason: image not found - /Library/Ruby/Gems/1.8/gems/mysql2-0.3.2/lib/mysql2/mysql2.bundle
/Users/home/Sites/demo/Rakefile:4

Full trace can be found here

This is my first rails question in Stack overflow. Thanks


This is a very common problem. The simple solution is to do the following in your Gemfile.

gem 'mysql2', '~> 0.2.7' # Not mysql2 version 0.3.2 like you have
gem 'rake', '~> 0.8.7' # Not rake version 0.9.0 like you have 

Blog Post

Any other versions above these dont work with Rails 3.0.0 - 3.0.8

Let us know how you get on. All the best.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜