2

在 Windows 7 上,尝试启动服务器时出现以下错误 [rails s]

C:/Ruby200/lib/ruby/gems/2.0.0/gems/mysql-2.9.1-x86-mingw32/lib/mysql.rb:6:in require': cannot load such file -- mysql/mysql_api (LoadError)
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/mysql-2.9.1-x86-mingw32/lib/mys
ql.rb:6:in 'rescue in <top (required)>'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/mysql-2.9.1-x86-mingw32/lib/mys
ql.rb:2:in '<top (required)>'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.2/lib/bundler/runti
me.rb:72:in 'require'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.2/lib/bundler/runti
me.rb:72:in 'block (2 levels) in require'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.2/lib/bundler/runti
me.rb:70:in 'each'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.2/lib/bundler/runti
me.rb:70:in 'block in require'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.2/lib/bundler/runti
me.rb:59:in 'each'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.2/lib/bundler/runti
me.rb:59:in 'require'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.2/lib/bundler.rb:13
2:in 'require'
        from C:/Users/tom_mckeon/Documents/rails/simple_cms/config/application.r
b:7:in '<top (required)>'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-3.2.12/lib/rails/comma
nds.rb:53:in 'require'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-3.2.12/lib/rails/comma
nds.rb:53:in 'block in <top (required)>'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-3.2.12/lib/rails/comma
nds.rb:50:in 'tap'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-3.2.12/lib/rails/comma
nds.rb:50:in '<top (required)>'
        from script/rails:6:in 'require'
        from script/rails:6:in '<main>'

我确实遵循了 mysql gem install 中的说明并复制 lib\libmysql.dll to C:\Ruby\bin
了我也尝试了 mysql2 gem 并得到了类似的错误

这些是我的系统规格:

 ruby 2.0.0p0 (2013-02-24) [i386-mingw32]
 Rails 3.2.12
 mysql (2.9.1 x86-mingw32)
 Server version: 5.1.68-community MySQL Community Server (GPL)
 Windows 7 
4

0 回答 0