rake aborted!
dlopen(/Users/ava/.rvm/gems/ruby-2.0.0-p247/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle, 9): Library not loaded: /usr/local/lib/libmysqlclient.18.dylib
Referenced from: /Users/ava/.rvm/gems/ruby-2.0.0-p247/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle
Reason: image not found - /Users/ava/.rvm/gems/ruby-2.0.0-p247/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle`
Ran the following to resolve:
$ sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib \
/usr/lib/libmysqlclient.18.dylib
ln: /usr/lib/libmysqlclient.18.dylib: File exists
My setup:
- OSX 10.8.4
- MySQL 5.1.71
libmysqlclient.16.dylib
$ locate libmysqlclient.16.dylib /usr/lib/libmysqlclient.16.dylib /usr/local/Cellar/mysql51/5.1.71/lib/mysql/libmysqlclient.16.dylib
libmysqlclient.18.dylib
$ locate libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib
In .bash_profile
, I have
export PATH="/usr/local/bin:$HOME/.rvm/bin:$HOME/bin:$PATH"
export DYLD_LIBRARY_PATH=/usr/local/bin/mysql
How to get this rake running? Am I supposed to have libmysqlclient.18.dylib
under /usr/local/Cellar/mysql51/5.1.71/lib/mysql
too? If yes, how do I create it?
Sorry, if I am mistaken; there is no Mac to check in details.
The error message clearly states, that the library
mysql
wants is:while the library you have is:
That definitely means, that your
mysql
installation is somehow broken, but for the quick patch I would recommend soft linking:You have likely misplaced arguments within your first solution try.
Instruct Mac OS X to find it as follows, if you are using Bash:
In your
~/.bash_profile
:Restart terminal.
For example, I have the following: