运行“rake db:migrate”时出现MySQL错误

时间:2012-08-06 20:34:32

标签: mysql ruby-on-rails ruby rake

是否有人建议如何继续修复此错误?

Tipsy:todoodly admin$ rake db:migrate
rake aborted!
dlopen(/Users/admin/.rvm/gems/ruby-1.9.3-p125/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle, 9): Library not loaded: /usr/local/lib/libmysqlclient.18.dylib
  Referenced from: /Users/admin/.rvm/gems/ruby-1.9.3-p125/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle
  Reason: no suitable image found.  Did find:
    /usr/lib/libmysqlclient.18.dylib: mach-o, but wrong architecture - /Users/admin/.rvm/gems/ruby-1.9.3-p125/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle

(See full trace by running task with --trace)

我尝试使用.dmg文件重新安装MySQL,但仍遇到问题。

在网上浏览后也试过这个,但仍然无法正常工作

sudo install_name_tool -change libmysqlclient.16.dylib /usr/local/mysql/lib/libmysqlclient.16.dylib ~/.rvm/gems/ruby-1.9.3-p125/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle

1 个答案:

答案 0 :(得分:0)

不确定它是否可行但是将其粘贴在终端中:

export DYLD_LIBRARY_PATH=”$DYLD_LIBRARY_PATH:/usr/local/mysql/lib/”