1

所以我正在尝试迁移我创建的数据库,但我不断收到这一系列错误。不知道该怎么办!谢谢

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)
4

1 回答 1

0

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

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

为我工作。

您可以在原始来源的此链接中找到更多信息:mysql2 library not loaded

于 2013-12-10T13:19:58.610 回答