Error de MySQL2 con RubyMine

Este es el mensaje de error:

/Users/JasonJiang/.rvm/rubies/ruby-1.9.2-p290/bin/ruby -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /Users/JasonJiang/RubymineProjects/untitled6/script/rails server -b 0.0.0.0 -p 3000 -e development
/Users/JasonJiang/.rvm/gems/ruby-1.9.2-p290/gems/mysql2-0.3.7/lib/mysql2.rb:9:in `require': dlopen(/Users/JasonJiang/.rvm/gems/ruby-1.9.2-p290/gems/mysql2-0.3.7/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib (LoadError)
Referenced from: /Users/JasonJiang/.rvm/gems/ruby-1.9.2-p290/gems/mysql2-0.3.7/lib/mysql2/mysql2.bundle
Reason: image not found - /Users/JasonJiang/.rvm/gems/ruby-1.9.2-p290/gems/mysql2-0.3.7/lib/mysql2/mysql2.bundle
from /Users/JasonJiang/.rvm/gems/ruby-1.9.2-p290/gems/mysql2-0.3.7/lib/mysql2.rb:9:in `<top (required)>'
from /Users/JasonJiang/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.1.rc/lib/bundler/runtime.rb:68:in `require'
from /Users/JasonJiang/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.1.rc/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
from /Users/JasonJiang/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.1.rc/lib/bundler/runtime.rb:66:in `each'
from /Users/JasonJiang/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.1.rc/lib/bundler/runtime.rb:66:in `block in require'
from /Users/JasonJiang/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.1.rc/lib/bundler/runtime.rb:55:in `each'
from /Users/JasonJiang/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.1.rc/lib/bundler/runtime.rb:55:in `require'
from /Users/JasonJiang/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.1.rc/lib/bundler.rb:128:in `require'
from /Users/JasonJiang/RubymineProjects/untitled6/config/application.rb:7:in `<top (required)>'
from /Users/JasonJiang/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands.rb:52:in `require'
from /Users/JasonJiang/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands.rb:52:in `block in <top (required)>'
from /Users/JasonJiang/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands.rb:49:in `tap'
from /Users/JasonJiang/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands.rb:49:in `<top (required)>'
from /Users/JasonJiang/RubymineProjects/untitled6/script/rails:6:in `require'
from /Users/JasonJiang/RubymineProjects/untitled6/script/rails:6:in `<top (required)>'
from -e:1:in `load'
from -e:1:in `<main>'

Process finished with exit code 1

Gracias a todos!

preguntado el 08 de noviembre de 11 a las 14:11

do you have libmysqlclient installed ? -

YES,it's already installed. in my mysql/lib folder, I can find libmysqlclient.18.dylib -

Please format the code properly. -

I solved it! thanks all. -

I think this SA post has a better solution: stackoverflow.com/questions/6596303/… -

1 Respuestas

I solved this by opening up my project in the terminal using the /usr/local/bin/mine command. e.g.

mine .

For some reason, RubyMine isn't using the same environment one uses when just running 'rake test' from the command line (even though it uses the right .rvm version).

Respondido 16 Feb 12, 22:02

Thanks. And this problem is still not solved in Rubymine 4.5. - Zabba

I still see it in Ruby 6, despite adding an explicit environment variable for DYLD_LIBRARY_PATH (which works from the shell nicely) - ctpenrose

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.