如何修复libmysqlclient.15.dylib未加载导致的错误?
作者:互联网
我已升级到Rails 2.2.2并安装了MySQL 2.7 gem,当我尝试运行迁移或启动服务器时看到此错误:
dlopen(/Library/Ruby/Gems/1.8/gems/mysql-2.7/lib/mysql.bundle, 9): Library not loaded: /usr/local/mysql/lib/mysql/libmysqlclient.15.dylib
Referenced from: /Library/Ruby/Gems/1.8/gems/mysql-2.7/lib/mysql.bundle
Reason: image not found - /Library/Ruby/Gems/1.8/gems/mysql-2.7/lib/mysql.bundle
有什么问题?
解决方法:
我不得不从旧引用中删除目录:
sudo install_name_tool -change libmysqlclient.18.dylib
/usr/local/mysql/lib/libmysqlclient.18.dylib
/Library/Ruby/Gems/1.8/gems/mysql-2.7/lib/mysql.bundle
sudo install_name_tool -change libmysqlclient.18.dylib
/usr/local/mysql/lib/libmysqlclient.18.dylib
/Library/Ruby/Gems/1.8/gems/mysql-2.7/mysql.bundle
标签:ruby-on-rails,mysql,rubygems 来源: https://codeday.me/bug/20191006/1861007.html