ruby-on-rails – rails无法加载这样的文件 – mysql2 / mysql2(LoadError)

前端之家收集整理的这篇文章主要介绍了ruby-on-rails – rails无法加载这样的文件 – mysql2 / mysql2(LoadError)前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我是 ruby on rails的新手我无法找到此错误解决方案:
rails s
/usr/local/share/gems/gems/MysqL2-0.3.13/lib/MysqL2.rb:8:in `require': cannot load such file -- MysqL2/MysqL2 (LoadError)
from /usr/local/share/gems/gems/MysqL2-0.3.13/lib/MysqL2.rb:8:in `<top (required)>'
from /usr/local/share/gems/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
from /usr/local/share/gems/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
from /usr/local/share/gems/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each'
from /usr/local/share/gems/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require'
from /usr/local/share/gems/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
from /usr/local/share/gems/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
from /usr/local/share/gems/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
from /home/Harish/Documents/simple_cms/config/application.rb:7:in `<top (required)>'
from /usr/local/share/gems/gems/railties-4.0.0/lib/rails/commands.rb:76:in `require'
from /usr/local/share/gems/gems/railties-4.0.0/lib/rails/commands.rb:76:in `block in <top (required)>'
from /usr/local/share/gems/gems/railties-4.0.0/lib/rails/commands.rb:73:in `tap'
from /usr/local/share/gems/gems/railties-4.0.0/lib/rails/commands.rb:73:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'

解决方法

gem uninstall MysqL2

gem install MysqL2 --platform=ruby

删除rails特定包目录中的MysqL2 gem目录并复制粘贴这个新安装的MysqL2 gem

猜你在找的Ruby相关文章