捆绑执行中无法识别rake 0.9.2

时间:2012-09-25 18:35:37

标签: ruby-on-rails rake bundle mysql2

这是我运行db:migrate时遇到的错误。

rake db:migrate rake aborted! You have already activated rake 0.9.2.2, but your Gemfile requires rake 0.9.2. Using bundle exec may solve this.

然后我运行bundle exec rake 0.9.2,这就是我得到的

    'rake aborted!dlopen(/Users/connorphillips/.rvm/gems/ruby-1.9.3-p194/gems/mysql2 0.2.11/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib Referenced from: /Users/connorphillips/.rvm/gems/ruby-1.9.3-p194/gems/mysql2-0.2.11/lib/mysql2/mysql2.bundle
  Reason: image not found - /Users/connorphillips/.rvm/gems/ruby-1.9.3-p194/gems/mysql2-0.2.11/lib/mysql2/mysql2.bundle'

1 个答案:

答案 0 :(得分:0)

您可能需要安装正确的MYSQL2 gem。在您的Gemfile中,请确保包含mysql2

gem 'mysql2'

然后重新绑定并尝试

bundle exec rake db:migrate