Can't start rails server mysql2 gem?

杀马特。学长 韩版系。学妹 提交于 2019-12-13 01:13:31

问题


Ruby and rails noob, made a project and got this far. But now I'm getting these errors when trying to run rails server. I'm using Windows vista and ruby 2.0.0.

D:/Ruby200/lib/ruby/gems/2.0.0/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2/mysql2.
rb:2:in `require': cannot load such file -- mysql2/2.0/mysql2 (LoadError)
        from D:/Ruby200/lib/ruby/gems/2.0.0/gems/mysql2-0.3.11-x86-mingw32/lib/m
ysql2/mysql2.rb:2:in `<top (required)>'
        from D:/Ruby200/lib/ruby/gems/2.0.0/gems/mysql2-0.3.11-x86-mingw32/lib/m
ysql2.rb:9:in `require'
        from D:/Ruby200/lib/ruby/gems/2.0.0/gems/mysql2-0.3.11-x86-mingw32/lib/m
ysql2.rb:9:in `<top (required)>'
        from D:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.4/lib/bundler/runti
me.rb:72:in `require'
        from D:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.4/lib/bundler/runti
me.rb:72:in `block (2 levels) in require'
        from D:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.4/lib/bundler/runti
me.rb:70:in `each'
        from D:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.4/lib/bundler/runti
me.rb:70:in `block in require'
        from D:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.4/lib/bundler/runti
me.rb:59:in `each'
        from D:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.4/lib/bundler/runti
me.rb:59:in `require'
        from D:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.4/lib/bundler.rb:13
2:in `require'
        from D:/wamp/www/simple_cms/config/application.rb:7:in `<top (required)>
'
        from D:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-3.2.13/lib/rails/comma
nds.rb:53:in `require'
        from D:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-3.2.13/lib/rails/comma
nds.rb:53:in `block in <top (required)>'
        from D:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-3.2.13/lib/rails/comma
nds.rb:50:in `tap'
        from D:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-3.2.13/lib/rails/comma
nds.rb:50:in `<top (required)>'
        from script/rails:6:in `require'
        from script/rails:6:in `<main>'

I know very little about ruby and gems so far but the mysql2 gem seems to be a problem wich I have installed and installed to no help. I do constantly get a message that I have installed the binary version with orders that I've followed. Is this a good or bad thing?

Anyone please help me out, if you need more info just let me know.


回答1:


I think the answer here is what you are looking for:

stackoverflow.com/a/5368767/1622843

Basically, you need to point the gem to use your mysql instance installed on your machine.



来源:https://stackoverflow.com/questions/15487703/cant-start-rails-server-mysql2-gem

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!