就像Meltemi在这篇文章中所说的那样:Passenger error "library not loaded"我也有同样的错误。但张贴的答案没有帮助!
dlopen(/Users/andi/.rvm/gems/ruby-1.9.2-p136/gems/mysql2-0.2.7/lib/mysql2/mysql2.bundle, 9):
Library not loaded: libmysqlclient.16.dylib
Referenced from: /Users/andi/.rvm/gems/ruby-1.9.2-p136/gems/mysql2-0.2.7/lib/mysql2/mysql2.bundle
Reason: image not found - /Users/andi/.rvm/gems/ruby-1.9.2-p136/gems/mysql2-0.2.7/lib/mysql2/mysql2.bundle
使用RVM 1.2.6、Rails 3.0.3、Ruby 1.9.2运行Im。服务器运行良好,直到我将存储库从svn切换到git。我觉得很奇怪,这个改变影响了我的安装。
$bundle list
Gems included by the bundle:
...
* mysql2 (0.2.7)
...
$ /usr/local/mysql-5.5.8-osx10.6-x86_64/bin/mysql --version
/usr/local/mysql-5.5.8-osx10.6-x86_64/bin/mysql Ver 14.14 Distrib 5.5.8, for osx10.6 (i386) using readline 5.1
thx响应!
编辑:解决方案:
根据rails server fails to start with mysql2 using rvm & ruby 1.9.2-p0 on OSX 10.6.5和http://freddyandersen.wordpress.com/2010/10/03/mysql-5-5-snow-leopard-and-rails/
这个命令解决了我的问题:
sudo install_name_tool-更改libmysqlclient.16.dylib/usr/local/mysql/lib/libmysqlclient.16.dylib~/.rvm/gems/ruby-1.9.2-p136/gems/mysql2-0.2.7/lib/mysql2/mysql2.bundle
最佳答案
解决方案:
根据rails,服务器无法在OSX 10.6.5上使用rvm和ruby 1.9.2-p0启动mysql2,并且http://freddyandersen.wordpress.com/2010/10/03/mysql-5-5-snow-leopard-and-rails/
这个命令解决了我的问题:sudo install_name_tool-change libmysqlclient.16.dylib/usr/local/mysql/lib/libmysqlclient.16.dylib~/.rvm/gems/ruby-1.9.2-p136/gems/mysql2-0.2.7/lib/mysql2/mysql2.bundle
关于mysql - mysql和passenger-错误“未加载库”,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/5854565/