0

我在 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”。有什么帮助吗?谢谢

4

2 回答 2

2

您安装的 mysql gem 期望libmysql.dll您的系统中可以使用特定版本的 MySQL(当您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/

希望有帮助。

于 2011-08-24T13:52:48.810 回答
0

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

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

于 2011-08-24T13:16:47.513 回答