运行ruby应用程序的问题

时间:2011-08-24 11:26:24

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

我在Windows上使用RubyMine,所以我可以在rails应用程序上运行给定的ruby。当我点击运行时,我收到以下错误:

C:\Ruby192\bin\ruby.exe -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) "F:/Aurora Zoo Project/zooniverse-Juggernaut-a46b0ba558f0cbeb8e9b581513691566d7f19c2f/script/rails" server -b 127.0.0.1 -p 3000 -e development
C:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql-2.8.1-x86-mingw32/lib/mysql.rb:7:in `require': 126: The specified module could not be found.   - C:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql-2.8.1-x86-mingw32/lib/1.9/mysql_api.so (LoadError)
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql-2.8.1-x86-mingw32/lib/mysql.rb:7:in `rescue in <top (required)>'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql-2.8.1-x86-mingw32/lib/mysql.rb:2:in `<top (required)>'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/runtime.rb:68:in `require'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/runtime.rb:66:in `each'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/runtime.rb:66:in `block in require'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/runtime.rb:55:in `each'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/runtime.rb:55:in `require'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler.rb:120:in `require'
    from F:/Aurora Zoo Project/zooniverse-Juggernaut-a46b0ba558f0cbeb8e9b581513691566d7f19c2f/config/application.rb:7:in `<top (required)>'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.5/lib/rails/commands.rb:28:in `require'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.5/lib/rails/commands.rb:28:in `block in <top (required)>'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.5/lib/rails/commands.rb:27:in `tap'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.5/lib/rails/commands.rb:27:in `<top (required)>'
    from F:/Aurora Zoo Project/zooniverse-Juggernaut-a46b0ba558f0cbeb8e9b581513691566d7f19c2f/script/rails:9:in `require'
    from F:/Aurora Zoo Project/zooniverse-Juggernaut-a46b0ba558f0cbeb8e9b581513691566d7f19c2f/script/rails:9:in `<top (required)>'
    from -e:1:in `load'
    from -e:1:in `<main>'

Process finished with exit code 1

我对ruby并不熟悉,但它说的是我已经安装并添加到PATH变量的“mysql”。 有帮助吗? THX

2 个答案:

答案 0 :(得分:2)

您安装的mysql gem期望系统中可以使用特定版本的MySQL libmysql.dll(当gem install mysql它在控制台中显示正确的图例时)。

mysql_api.so无法加载,因此会产生您看到的错误。

我发表了一篇关于安装和编译MySQL组件的替代方法,与您安装的MySQL版本无关。

http://blog.mmediasys.com/2011/07/07/installing-mysql-on-windows-7-x64-and-using-ruby-with-it/

希望有所帮助。

答案 1 :(得分:0)

这可能是版本问题。当我使用旧的mysql版本和新的mysql gem时,我确实遇到了同样的问题。

请找到mysql服务器所需的正确gem。