编程,ruby,rails,sql等新手。跟随视频教程,但遇到了这个错误。任何帮助表示赞赏。
C:\sites\simple_cms>rails s
c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/mysql2-0.3.15/lib/mysql2.rb:8:in `requir
e': 126: The specified module could not be found. - c:/ruby200-x64/lib/ruby/ge
ms/2.0.0/extensions/x64-mingw32/2.0.0/mysql2-0.3.15/mysql2/mysql2.so (LoadError)
from c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/mysql2-0.3.15/lib/mysql2.rb
:8:in `<top (required)>'
from c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.6.0.pre.2/lib/bun
dler/runtime.rb:76:in `require'
from c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.6.0.pre.2/lib/bun
dler/runtime.rb:76:in `block (2 levels) in require'
from c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.6.0.pre.2/lib/bun
dler/runtime.rb:72:in `each'
from c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.6.0.pre.2/lib/bun
dler/runtime.rb:72:in `block in require'
from c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.6.0.pre.2/lib/bun
dler/runtime.rb:61:in `each'
from c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.6.0.pre.2/lib/bun
dler/runtime.rb:61:in `require'
from c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.6.0.pre.2/lib/bun
dler.rb:132:in `require'
from C:/sites/simple_cms/config/application.rb:7:in `<top (required)>'
from c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.0.2/lib/rails/co
mmands.rb:74:in `require'
from c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.0.2/lib/rails/co
mmands.rb:74:in `block in <top (required)>'
from c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.0.2/lib/rails/co
mmands.rb:71:in `tap'
from c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.0.2/lib/rails/co
mmands.rb:71:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
C:\sites\simple_cms>
答案 0 :(得分:0)
我们需要从头开始:
gem install bundler
gem install mysql2
未正确安装,您可能需要以下内容:gem install mysql2 -- --with-mysql-dir="C:\mysql\bin"
;将c:\mysql\bin
更改为您在步骤4中安装mysql的位置gem install rails
bundle install
rails s
Windows上的Rails开发已经取得了很大的进步但是如果你真的想要保持最新并避免将来出现一些奇怪的问题(特别是在支持gem的情况下),我建议你使用Ubuntu作为例子。如果您没有其他计算机或者不希望进行双重启动,则可以免费安装VirtualBox
(https://www.virtualbox.org/wiki/Downloads)并在其上运行Ubuntu。