在Windows上启动Ruby服务器时出错

时间:2015-03-30 16:11:13

标签: ruby-on-rails ruby rubygems

我得到的错误如下:

  

C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/mysql2-0.3.18-x64-mingw32/lib/m   ysql2 / mysql2.rb:2:在require':无法加载这样的文件 - mysql2 / 2.2 / my   sql2(LoadError)               来自C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/mysql2-0.3.18-x64-   mingw32 / lib / mysql2 / mysql2.rb:2:in'               来自C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/mysql2-0.3.18-x64-   mingw32 / lib / mysql2.rb:31:in require'               来自C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/mysql2-0.3.18-x64-   mingw32 / lib / mysql2.rb:31:in'               来自C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.9.1/lib/   bundler / runtime.rb:76:in require'               来自C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.9.1/lib/   bundler / runtime.rb:76:在块中(2级)in require'               来自C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.9.1/lib/   bundler / runtime.rb:72:in each'               来自C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.9.1/lib/   bundler / runtime.rb:72:in block in require'               来自C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.9.1/lib/   bundler / runtime.rb:61:in each'               来自C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.9.1/lib/   bundler / runtime.rb:61:in require'               来自C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.9.1/lib/   bundler.rb:134:in require'               来自D:/xampp/htdocs/RubyCms/config/application.rb:7:in'               来自C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib   /rails/commands/commands_tasks.rb:78:in要求'               来自C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib   /rails/commands/commands_tasks.rb:78:in在服务器块'               来自C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib   /rails/commands/commands_tasks.rb:75:in tap'               来自C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib   /rails/commands/commands_tasks.rb:75:in server'               来自C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib   /rails/commands/commands_tasks.rb:39:in run_command!'               来自C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib   /rails/commands.rb:17:in'               来自bin / rails:4:in require'               来自bin / rails:4:在'

我真的不知道出了什么问题。

非常感谢任何帮助。

1 个答案:

答案 0 :(得分:0)

当我意外地创建了一个带有默认数据库(sqlite3)的新Rails应用程序但实际安装了mysql2时,我遇到了同样的错误。

检查您安装的数据库以及gemfile中需要的数据库。