mysql gem looking for an earlier version of libmysqlclient.16.dylib

廉价感情. 提交于 2019-12-13 01:43:12

问题


I just upgraded to Mac OSX Snow Leopard, and recompiled mysql (5.1.39) with the Snow Leopard XCode. I also reinstalled the latest mysql gem.

Now, when running

rake db:migrate

in a rails app, I get

dyld: NSLinkModule() error
dyld: Library not loaded: /usr/local/mysql/lib/libmysqlclient.15.dylib
Referenced from: /usr/local/lib/ruby/gems/1.8/gems/mysql-2.7/lib/mysql.bundle
Reason: image not found
Trace/BPT trap

I have /usr/local/mysql/lib/libmysqlclient.16.dylib, but not ...15.dylib.

Do I need to use an earlier version of mysql?


回答1:


No it almost looks like you need to remove the mysql gem and then re-install it using gem install mysql -- --with-mysql-dir=/path/to/mysql_dir (sometimes /usr/local/mysql)




回答2:


Try hammering in which version of mysql for the gem to use:

gem install mysql -- --with-mysql-config=/path/to/mysql_config




回答3:


Thanks for the help!

I ended up removing mysql completely:

http://akrabat.com/2008/09/11/uninstalling-mysql-on-mac-os-x-leopard/

Then compiling and installing the following to /usr/local:

readline 6.0 ruby 1.8.7 rubygems

With help from

http://hivelogic.com/articles/compiling-ruby-rubygems-and-rails-on-snow-leopard



来源:https://stackoverflow.com/questions/1677588/mysql-gem-looking-for-an-earlier-version-of-libmysqlclient-16-dylib

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