Forum: Ruby on Rails '$ rake db:create' don't work!

13c080b319293b68589d25e303fb7797?d=identicon&s=25 romenig damasio (romenig)
on 2013-11-27 00:14
Hey guys,
 I'm new to learning RoR and I try to do a database with mysql and I
have a problem.
First I create a a folder in my desktop and after with command in the
terminal on Mac Os Mavericks I create a project:
rails new vota_prato -d mysql

after I will try to create a database with this command:

$ rake db:create

and I have this error:
MacBook-Pro-de-Romenig:vota_prato romenig$ rake db:create
rake aborted!
dlopen(/Users/romenig/.rvm/gems/ruby-2.0.0-p247/gems/mysql2-0.3.14/lib/mysql2/mysql2.bundle,
9): Library not loaded: libmysqlclient.18.dylib
  Referenced from:
/Users/romenig/.rvm/gems/ruby-2.0.0-p247/gems/mysql2-0.3.14/lib/mysql2/mysql2.bundle
  Reason: image not found -
/Users/romenig/.rvm/gems/ruby-2.0.0-p247/gems/mysql2-0.3.14/lib/mysql2/mysql2.bundle
/Users/romenig/.rvm/gems/ruby-2.0.0-p247/gems/mysql2-0.3.14/lib/mysql2.rb:8:in
`require'
/Users/romenig/.rvm/gems/ruby-2.0.0-p247/gems/mysql2-0.3.14/lib/mysql2.rb:8:in
`<top (required)>'
/Users/romenig/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in
`require'
/Users/romenig/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in
`block (2 levels) in require'
/Users/romenig/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in
`each'
/Users/romenig/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in
`block in require'
/Users/romenig/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in
`each'
/Users/romenig/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in
`require'
/Users/romenig/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler.rb:132:in
`require'
/Users/romenig/Desktop/caelum_ror/vota_prato/config/application.rb:7:in
`<top (required)>'
/Users/romenig/Desktop/caelum_ror/vota_prato/Rakefile:4:in `require'
/Users/romenig/Desktop/caelum_ror/vota_prato/Rakefile:4:in `<top
(required)>'
/Users/romenig/.rvm/gems/ruby-2.0.0-p247/bin/ruby_executable_hooks:15:in
`eval'
/Users/romenig/.rvm/gems/ruby-2.0.0-p247/bin/ruby_executable_hooks:15:in
`<main>'
(See full trace by running task with --trace)



What I need to do for running good? Before install the RVM for RoR I
have installed the MySql who I do projects with Java.
Someone could help me with this error?
O want to continue my studies and I really like Ruby on Rails do the
things it's exciting!
Thank's!
A650031adbcdb5470d7fde256fd4db80?d=identicon&s=25 James Turley (Guest)
on 2013-11-27 14:40
(Received via mailing list)
This seems to be a common issue (affects some Python users as well). The
install of libmysqlclient seems not to be on your PATH.

A stackoverflow question came up with this solution:

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

(ie, you symlink the file onto your path).
A650031adbcdb5470d7fde256fd4db80?d=identicon&s=25 James Turley (Guest)
on 2013-11-27 14:44
(Received via mailing list)
(SO link:
http://stackoverflow.com/questions/4546698/library...
 )


On Wed, Nov 27, 2013 at 1:29 PM, James Turley <
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.