服务器启动时mysql2 GemRequireError

时间:2016-02-29 17:30:05

标签: mysql ruby-on-rails ruby mysql2

我正在尝试启动并运行旧的Ruby on Rails项目。该项目使用Ruby 1.9.3p484和一堆宝石,包括mysql2,这些宝石在我运行bundle install时都已成功安装。但是,当我运行script/rails server(就像我说的旧版本的RoR)时,我得到以下 mysql2 错误:

  

/Users/ryan/.rvm/gems/ruby-1.9.3-p484@iwny/gems/bundler-1.11.2/lib/bundler/runtime.rb:81:in在块中救援(2级)在require':尝试加载gem'mysql2'时出错。 (捆扎机:: GemRequireError)

和堆栈跟踪:

/Users/ryan/.rvm/gems/ruby-1.9.3-p484@iwny/gems/bundler-1.11.2/lib/bundler/runtime.rb:81:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'mysql2'. (Bundler::GemRequireError)
    from /Users/ryan/.rvm/gems/ruby-1.9.3-p484@iwny/gems/bundler-1.11.2/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
    from /Users/ryan/.rvm/gems/ruby-1.9.3-p484@iwny/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `each'
    from /Users/ryan/.rvm/gems/ruby-1.9.3-p484@iwny/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `block in require'
    from /Users/ryan/.rvm/gems/ruby-1.9.3-p484@iwny/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `each'
    from /Users/ryan/.rvm/gems/ruby-1.9.3-p484@iwny/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `require'
    from /Users/ryan/.rvm/gems/ruby-1.9.3-p484@iwny/gems/bundler-1.11.2/lib/bundler.rb:99:in `require'
    from /Users/ryan/vagrant/source/adage/web/htdocs/iwny/config/application.rb:8:in `<top (required)>'
    from /Users/ryan/.rvm/gems/ruby-1.9.3-p484@iwny/gems/railties-3.0.20/lib/rails/commands.rb:28:in `require'
    from /Users/ryan/.rvm/gems/ruby-1.9.3-p484@iwny/gems/railties-3.0.20/lib/rails/commands.rb:28:in `block in <top (required)>'
    from /Users/ryan/.rvm/gems/ruby-1.9.3-p484@iwny/gems/railties-3.0.20/lib/rails/commands.rb:27:in `tap'
    from /Users/ryan/.rvm/gems/ruby-1.9.3-p484@iwny/gems/railties-3.0.20/lib/rails/commands.rb:27:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'

就像我说的那样,bundle install工作得很好。 Gemfile包含

gem 'mysql2', '< 0.3'

以及各种软件的版本包括以下内容:

  • ruby​​ 1.9.3p484
  • rails 3.0.20
  • rake 10.0.3
  • rspec 2.12.2
  • rake-compiler 10.5.0
  • mysql:Server version: 5.5.44-37.3-log Source distribution

我不能真正搞乱太多的核心东西,因为这是一个既定的网站/回购,所以我必须使用我在这里的东西。

0 个答案:

没有答案