1

我已使用 RVM 将我的 ruby​​ 版本更新为 2.0.0。然后安装mysql2 gem

-> % gem install mysql2
Building native extensions.  This could take a while...
Successfully installed mysql2-0.3.13
1 gem installed
Installing ri documentation for mysql2-0.3.13...
Building YARD (yri) index for mysql2-0.3.13...
Installing RDoc documentation for mysql2-0.3.13...

之后,我尝试mysql2在 irb 中要求。但它会导致以下错误!

-> % irb
2.0.0p247 :001 > require 'mysql2'
LoadError: cannot load such file -- mysql2/mysql2
    from /home/sayuj/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/custom_require.rb:36:in `require'
    from /home/sayuj/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/custom_require.rb:36:in `require'
    from /home/sayuj/.rvm/gems/ruby-2.0.0-p247/gems/mysql2-0.3.13/lib/mysql2.rb:8:in `<top (required)>'
    from /home/sayuj/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/custom_require.rb:60:in `require'
    from /home/sayuj/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/custom_require.rb:60:in `rescue in require'
    from /home/sayuj/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/custom_require.rb:35:in `require'
    from (irb):1
    from /home/sayuj/.rvm/rubies/ruby-2.0.0-p247/bin/irb:16:in `<main>'

我该如何解决。请帮助我。

4

1 回答 1

0

更新您的 RVMrvm get stable 并重新安装 ruby​​2

rvm uninstall ruby-2.0.0-p247
rvm install ruby-2.0.0-p247

这将起作用。

于 2013-08-28T09:52:46.783 回答