Since I upgraded OSX to 10.11, I can\'t use MySQL with my Rails app anymore:
$ rails s
/Users/josh/.rvm/gems/ruby-2.2.3@a4aa2/gems/activesupport-4.2.1/lib/ac
The previous answer (pre El Capitan), was to create a symbolic link from mysql's lib directory for the library file into /usr/lib, like this:
sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib
However this now produces 'operation not permitted' due to OS X's integrity controls. This can be worked around by disabling this. However a much easier solution (and one I can verify has worked) is to just symlink it into /usr/local/lib instead:
sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/local/lib/libmysqlclient.18.dylib
Good ol' Apple.
i had the same problem just open terminal hit:
sudo nano ~/.bash_profile
paste the following lines:
MYSQL=/usr/local/mysql/bin
export PATH=$PATH:$MYSQL
export DYLD_LIBRARY_PATH=/usr/local/mysql/lib:$DYLD_LIBRARY_PATH
and thats it.