Abhimanyu
Abhimanyu

Reputation: 589

Command rake db:schema:dump not working properly

The following rake command doesn't work

rake db:schema:dump
/Library/Ruby/Gems/1.8/gems/bundler-1.1.4/lib/bundler/runtime.rb:211: warning: Insecure world writable dir /usr/local in PATH, mode 040777
rake aborted!
dlopen(/Library/Ruby/Gems/1.8/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib
  Referenced from: /Library/Ruby/Gems/1.8/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle
  Reason: image not found - /Library/Ruby/Gems/1.8/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle

Upvotes: 0

Views: 554

Answers (4)

coneybeare
coneybeare

Reputation: 33101

You need to install mysql. I recommend installing a package manager such as Homebrew, then doing a simple brew install mysql

Upvotes: 3

peterpengnz
peterpengnz

Reputation: 6072

In my case: Mountain Lion with mysql 5.5 and ruby 1.9.3 installed by RVM

The file libmysqlclient.18.dylib lives in

/usr/local/mysql-5.5.25a-osx10.6-x86_64/lib/libmysqlclient.18.dylib

I copied this file to "/usr/lib" folder and it fixed the error.

sudo cp /usr/local/mysql-5.5.25a-osx10.6-x86_64/lib/libmysqlclient.18.dylib /usr/lib/

Upvotes: 0

davidb
davidb

Reputation: 8954

You need to install mysql-client and libmysqlclient-dev excepting your using a debian based linux. Anyway you need these libaries which are NOT part of the mysql-server package!

Upvotes: 0

rekenerd
rekenerd

Reputation: 462

Your are probably missing something about a correct installation on osx and with a correct distribution of mysql libraries.
The fastest way of getting rid of this problem was a:

$ sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib

use the

$ sudo install_name_tool -change libmysqlclient.18.dylib /usr/local/mysql-5.5.15-osx10.6-x86_64/lib/libmysqlclient.18.dylib /Library/Ruby/Gems/1.8/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle

should be the proper solution

Note: Copied from here

Upvotes: 2

Related Questions