无法启动Rails服务器(MySQL Windows)

时间:2015-06-08 19:59:30

标签: mysql ruby-on-rails windows server

我似乎无法使用mysql2 gem启动MySQL服务器

这是我的具体错误

D:\Ruby Workspace\sites\simple_cms>rails s
C:/Ruby22/lib/ruby/gems/2.2.0/gems/mysql2-0.3.18-x86-mingw32/lib/mysql2/mysql2.rb:2:in `require': cannot load such file -- mysql2/2.2/mysql2 (LoadError)
    from C:/Ruby22/lib/ruby/gems/2.2.0/gems/mysql2-0.3.18-x86-mingw32/lib/mysql2/mysql2.rb:2:in `<top (required)>'
    from C:/Ruby22/lib/ruby/gems/2.2.0/gems/mysql2-0.3.18-x86-mingw32/lib/mysql2.rb:31:in `require'
    from C:/Ruby22/lib/ruby/gems/2.2.0/gems/mysql2-0.3.18-x86-mingw32/lib/mysql2.rb:31:in `<top (required)>'
    from C:/Ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.10.3/lib/bundler/runtime.rb:76:in `require'
    from C:/Ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.10.3/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
    from C:/Ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.10.3/lib/bundler/runtime.rb:72:in `each'
    from C:/Ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.10.3/lib/bundler/runtime.rb:72:in `block in require'
    from C:/Ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.10.3/lib/bundler/runtime.rb:61:in `each'
    from C:/Ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.10.3/lib/bundler/runtime.rb:61:in `require'
    from C:/Ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.10.3/lib/bundler.rb:134:in `require'
    from D:/Ruby Workspace/sites/simple_cms/config/application.rb:7:in `<top (required)>'
    from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:78:in `require'
    from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:78:in `block in server'
    from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:75:in `tap'
    from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:75:in `server'
    from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
    from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands.rb:17:in `<top (required)>'
    from bin/rails:4:in `require'
    from bin/rails:4:in `<main>'

我已将libmysql.dll放在我的Ruby bin文件夹中,但没有运气

我试着指向我的MySQL服务器5.6 \ lib并包含文件夹但没有运气

我认为这里的主要问题是:'require': cannot load such file -- mysql2/2.2/mysql2

但我不确定如何解决这个问题,因为指向MySQL服务器5.6没有工作,mySQL连接器也没有。

1 个答案:

答案 0 :(得分:0)

使用railsFTW结束,似乎最新版本彼此不兼容。

railsFTW是一个Windows软件包安装程序,提供了开始使用rails所需的一切。

&#39;编辑&#39;我还遇到了基于浏览器的IDE,忽略了你正在运行的系统。我会建议cloud9's IDE任何一天本地安装rails to windows。