Muhammed Ziauddin
Muhammed Ziauddin

Reputation: 1

Why is my rake db:migrate failing to respond?

I tried typing in rake db:migrate to create a migration, but my rake is aborted and giving me this statement. Could you please explain why this is happening?

Muhammeds-MacBook-Pro:simple_cms muhammedz786$ rake db:migrate
rake aborted!
dlopen(/Users/muhammedz786/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/extensions/x86_64-darwin-13/2.1.0-static/mysql2-0.3.14/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib
  Referenced from: /Users/muhammedz786/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/extensions/x86_64-darwin-13/2.1.0-static/mysql2-0.3.14/mysql2/mysql2.bundle
  Reason: image not found - /Users/muhammedz786/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/extensions/x86_64-darwin-13/2.1.0-static/mysql2-0.3.14/mysql2/mysql2.bundle
/Users/muhammedz786/rails_application/simple_cms/config/application.rb:7:in `<top (required)>'
/Users/muhammedz786/rails_application/simple_cms/Rakefile:4:in `<top (required)>'
(See full trace by running task with --trace)

Upvotes: 0

Views: 76

Answers (2)

Travis Pessetto
Travis Pessetto

Reputation: 3298

From your question I see you are on a Macintosh. Therefore, try the following:

  1. Run mysql_install_db in the terminal
  2. Run mysql.server start in the terminal
  3. If that doesn't work checkout Installing mysql2 gem for Ruby on Rails with Mac OSX 10.6

Upvotes: 1

HarsHarI
HarsHarI

Reputation: 911

your mysql package not install properly for that give command

sudo apt-get install mysql-server mysql-common mysql-client

if this is not work install this

sudo apt-get install libmysql-ruby libmysqlclient-dev

Upvotes: 1

Related Questions