Rails + MySQL on Mavericks - Library not loaded: libmysqlclient.18.dylib

陌路散爱 提交于 2019-12-05 18:01:57

I had the same problem. Because I installed it with brew, the location of the DYLD changed. Try this:

export DYLD_LIBRARY_PATH=/usr/local/mysql-5.1.67-osx10.6-x86_64/lib:$DYLD_LIBRARY_PATH

Check if the path above exists first with something like the following and obviously adjust the export path accordingly:

ls -1 /usr/local/mysql-5.1.67-osx10.6-x86_64

You could probably make a symbolic link or something. It was kind of annoying for me, but using the correct path fixed it for me.

And also try which mysql to check if you have mysql in your path. If you don't get any output obviously the paths are messed up.

sudo install_name_tool -change libmysqlclient.18.dylib /usr/local/mysql/lib/libmysqlclient.18.dylib ~/.rvm/gems/ruby-2.0.0-p481/extensions/x86_64-darwin-13/2.0.0-static/mysql2-0.3.16/mysql2/mysql2.bundle

This should work for you.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!