3

全部,

我下载/安装了 1.9.2 windows 安装程序,然后是 RubyMine3.0RC,并安装了它。

打开一个新的 Rails 项目,选择 mysql 作为数据库,当我“运行”它时会出现以下错误。

D:\ProgramFiles\Ruby192\bin\ruby.exe -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) C:/Users/Rob/RubymineProjects/test1/script/rails server -p 3000 -b 127.0.0.1 -e development
D:/ProgramFiles/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/mysql2/mysql2.rb:2:in `require': 126: The specified module could not be found.   - D:/ProgramFiles/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/mysql2/1.9/mysql2.so (LoadError)
    from D:/ProgramFiles/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/mysql2/mysql2.rb:2:in `<top (required)>'
    from D:/ProgramFiles/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/mysql2.rb:7:in `require'
    from D:/ProgramFiles/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/mysql2.rb:7:in `<top (required)>'
    from D:/ProgramFiles/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/runtime.rb:64:in `require'
    from D:/ProgramFiles/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/runtime.rb:64:in `block (2 levels) in require'
    from D:/ProgramFiles/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/runtime.rb:62:in `each'
    from D:/ProgramFiles/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/runtime.rb:62:in `block in require'
    from D:/ProgramFiles/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/runtime.rb:51:in `each'
    from D:/ProgramFiles/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/runtime.rb:51:in `require'
    from D:/ProgramFiles/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler.rb:112:in `require'
    from C:/Users/Rob/RubymineProjects/test1/config/application.rb:7:in `<top (required)>'
    from D:/ProgramFiles/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/commands.rb:28:in `require'
    from D:/ProgramFiles/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/commands.rb:28:in `block in <top (required)>'
    from D:/ProgramFiles/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/commands.rb:27:in `tap'
    from D:/ProgramFiles/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/commands.rb:27:in `<top (required)>'
    from C:/Users/Rob/RubymineProjects/test1/script/rails:6:in `require'
    from C:/Users/Rob/RubymineProjects/test1/script/rails:6:in `<top (required)>'
    from -e:1:in `load'
    from -e:1:in `<main>'

Process finished with exit code 1

这应该发生吗?我也安装了 mysql2 gem,但仍然在控制台中看到这些消息。

谢谢你的帮助!

4

2 回答 2

9

确保您在 PATH 或 RUBY_HOME\bin 目录中有来自 5.1.x 32 位 MySQL 发行版的libmysql.dll 。

如果它没有帮助,您可能会在mysql2 gem 项目主页上报告该问题。

于 2010-11-22T04:00:30.253 回答
2

谢谢,我可以通过将“libmySQL.dll”文件从“C:\Program Files\MySQL\MySQL Server 5.1\bin”复制到“C:\Ruby192\bin”来修复错误。有关详细信息,请参阅帖子 - http://rorguide.blogspot.com/2011/03/getting-error-specified-module-could.html

于 2011-03-31T12:15:06.473 回答