0

以下rake命令不起作用

rake db:schema:dump
/Library/Ruby/Gems/1.8/gems/bundler-1.1.4/lib/bundler/runtime.rb:211: warning: Insecure world writable dir /usr/local in PATH, mode 040777
rake aborted!
dlopen(/Library/Ruby/Gems/1.8/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib
  Referenced from: /Library/Ruby/Gems/1.8/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle
  Reason: image not found - /Library/Ruby/Gems/1.8/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle
4

4 回答 4

3

您需要安装mysql. 我建议安装一个包管理器,比如Homebrew,然后做一个简单的brew install mysql

于 2012-07-08T17:27:32.023 回答
2

您可能缺少有关在 osx 上正确安装和正确分发 mysql 库的信息。
摆脱这个问题的最快方法是:

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

使用

$ sudo install_name_tool -change libmysqlclient.18.dylib /usr/local/mysql-5.5.15-osx10.6-x86_64/lib/libmysqlclient.18.dylib /Library/Ruby/Gems/1.8/gems/mysql2-0.3.11 /lib/mysql2/mysql2.bundle

应该是正确的解决方案

注:从这里复制

于 2012-07-08T17:37:17.563 回答
0

You need to install mysql-client and libmysqlclient-dev excepting your using a debian based linux. Anyway you need these libaries which are NOT part of the mysql-server package!

于 2012-07-09T14:10:22.470 回答
0

就我而言:RVM 安装了 mysql 5.5 和 ruby​​ 1.9.3 的 Mountain Lion

文件 libmysqlclient.18.dylib 位于

/usr/local/mysql-5.5.25a-osx10.6-x86_64/lib/libmysqlclient.18.dylib

我将此文件复制到“/usr/lib”文件夹并修复了错误。

sudo cp /usr/local/mysql-5.5.25a-osx10.6-x86_64/lib/libmysqlclient.18.dylib /usr/lib/
于 2012-08-02T11:12:44.187 回答