ruby 1.9.3 db:迁移问题

时间:2013-03-24 15:45:25

标签: mysql ruby-on-rails-3 rake

所以我试图迁移我创建的数据库,并不断收到这一串错误。不知道该怎么办!谢谢

Camerons-MacBook-Air:depot Cameron$ rake db:migrate
rake aborted!
dlopen(/Users/Cameron/.rvm/gems/ruby-1.9.3-p392/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib
Referenced from: /Users/Cameron/.rvm/gems/ruby-1.9.3-p392/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle
Reason: image not found - /Users/Cameron/.rvm/gems/ruby-1.9.3-p392/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle
/Users/Cameron/.rvm/gems/ruby-1.9.3-p392/gems/mysql2-0.3.11/lib/mysql2.rb:9:in `require'
/Users/Cameron/.rvm/gems/ruby-1.9.3-p392/gems/mysql2-0.3.11/lib/mysql2.rb:9:in `<top (required)>'
/Users/Cameron/.rvm/gems/ruby-1.9.3-p392@global/gems/bundler-1.3.4/lib/bundler/runtime.rb:72:in `require'
/Users/Cameron/.rvm/gems/ruby-1.9.3-p392@global/gems/bundler-1.3.4/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
/Users/Cameron/.rvm/gems/ruby-1.9.3-p392@global/gems/bundler-1.3.4/lib/bundler/runtime.rb:70:in `each'
/Users/Cameron/.rvm/gems/ruby-1.9.3-p392@global/gems/bundler-1.3.4/lib/bundler/runtime.rb:70:in `block in require'
/Users/Cameron/.rvm/gems/ruby-1.9.3-p392@global/gems/bundler-1.3.4/lib/bundler/runtime.rb:59:in `each'
/Users/Cameron/.rvm/gems/ruby-1.9.3-p392@global/gems/bundler-1.3.4/lib/bundler/runtime.rb:59:in `require'
/Users/Cameron/.rvm/gems/ruby-1.9.3-p392@global/gems/bundler-1.3.4/lib/bundler.rb:132:in `require'
/Users/Cameron/depot/config/application.rb:7:in `<top (required)>'
/Users/Cameron/depot/Rakefile:5:in `require'
/Users/Cameron/depot/Rakefile:5:in `<top (required)>'
/Users/Cameron/.rvm/gems/ruby-1.9.3-p392/bin/ruby_noexec_wrapper:14:in `eval'
/Users/Cameron/.rvm/gems/ruby-1.9.3-p392/bin/ruby_noexec_wrapper:14:in `<main>'
(See full trace by running task with --trace)

1 个答案:

答案 0 :(得分:0)

我做了一些研究和这行代码

sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib

为我工作。

您可以在原始来源的mysql2 library not loaded

中找到此链接中的更多信息