RubyMine发生MySQL2错误

时间:2011-11-08 14:50:42

标签: ruby-on-rails-3

这是错误消息:

/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

全部谢谢!

1 个答案:

答案 0 :(得分:9)

我通过使用/ usr / local / bin / mine命令在终端中打开我的项目来解决这个问题。 e.g。

mine .

出于某种原因,RubyMine没有使用从命令行运行'rake test'时使用的相同环境(即使它使用正确的.rvm版本)。