Rails生成命令错误?

时间:2014-06-23 19:48:20

标签: ruby-on-rails ruby ruby-on-rails-3 ruby-1.9.3

我正在尝试在现有的Rails网站上使用Rails generate命令来创建一个新的控制器。

我将存储库检出到我的本地系统,但是当我尝试运行generate命令时,我收到以下错误:

C:/Ruby/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2/mysql2.rb:
2:in `require': 126: The specified module could not be found.   - C:/Ruby/lib/ru
by/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2/1.9/mysql2.so (LoadError
)
        from C:/Ruby/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysq
l2/mysql2.rb:2:in `<top (required)>'
        from C:/Ruby/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysq
l2.rb:9:in `require'
        from C:/Ruby/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysq
l2.rb:9:in `<top (required)>'
        from C:/Ruby/lib/ruby/gems/1.9.1/gems/bundler-1.6.3/lib/bundler/runtime.
rb:76:in `require'
        from C:/Ruby/lib/ruby/gems/1.9.1/gems/bundler-1.6.3/lib/bundler/runtime.
rb:76:in `block (2 levels) in require'
        from C:/Ruby/lib/ruby/gems/1.9.1/gems/bundler-1.6.3/lib/bundler/runtime.
rb:72:in `each'
        from C:/Ruby/lib/ruby/gems/1.9.1/gems/bundler-1.6.3/lib/bundler/runtime.
rb:72:in `block in require'
        from C:/Ruby/lib/ruby/gems/1.9.1/gems/bundler-1.6.3/lib/bundler/runtime.
rb:61:in `each'
        from C:/Ruby/lib/ruby/gems/1.9.1/gems/bundler-1.6.3/lib/bundler/runtime.
rb:61:in `require'
        from C:/Ruby/lib/ruby/gems/1.9.1/gems/bundler-1.6.3/lib/bundler.rb:132:i
n `require'
        from C:/Users/dboliver/Desktop/Assorted Items/RB_OLTARIS/branch/rails_3_
dev/config/application.rb:15:in `<top (required)>'
        from C:/Ruby/lib/ruby/gems/1.9.1/gems/railties-3.2.13/lib/rails/commands
.rb:24:in `require'
        from C:/Ruby/lib/ruby/gems/1.9.1/gems/railties-3.2.13/lib/rails/commands
.rb:24:in `<top (required)>'
        from script/rails:6:in `require'
        from script/rails:6:in `<main>'

1 个答案:

答案 0 :(得分:0)

确保MySQL正在运行,您可以运行

mysql.server start

命令确认

然后,运行

bundle install

验证MySQL gem也已安装