新系统上升级到Rails 3的Rails应用程序没有使用Mongrel

时间:2022-02-14 00:01:16

Given:

考虑到:

  • A rails 2.3.x application currently being upgraded to rails 3.
  • rails 2.3。x应用程序目前正在升级到rails 3。
  • Upgrading ruby from 1.8.7 to 1.9.2
  • 将ruby从1.8.7升级到1.9.2
  • The rails app WAS using mongrel as the web server for development.
  • rails应用程序使用mongrel作为web服务器进行开发。
  • A new fresh install of Ubuntu 10.10 Netbook remix.
  • 全新安装的Ubuntu 10.10上网本remix。
  • I forgot to install mongrel before starting the upgrade so...
  • 我在开始升级之前忘记安装了mongrel,所以……

The Problem:

存在的问题:

After updating some code so that delayed job is working, I go to run rails s and I realize that I'm running WEBrick. I install mongrel: gem install mongrel --pre for the 1.9.2 version and run rails s again. Its still using WEBrick, which wasn't the expected behavior. Before, I would just install mongrel and rails would know that I wanted mongrel instead.

在更新了一些代码以使延迟的作业正常工作之后,我运行rails s并意识到我正在运行WEBrick。我安装了mongrel: gem安装了mongrel——为1.9.2版本预安装,并再次运行rails s。它仍然在使用WEBrick,这不是预期的行为。在此之前,我只需要安装mongrel和rails就可以知道我想要的是mongrel。

Also, I'm getting this error when WEBrick runs... it starts and then errors and shuts down. (maybe due to upgrading or... maybe WEBrick doesn't like ruby 1.9.2?):

而且,当WEBrick运行时,我得到了这个错误……它开始,然后出错,然后关闭。(可能是升级或…)也许WEBrick不喜欢ruby 1.9.2?)

=> Booting WEBrick
=> Rails 3.0.5 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/home/aaron/dev/onlinescheduler/config/initializers/new_rails_defaults.rb:14:in `<top (required)>': undefined method `generate_best_match=' for ActionDispatch::Routing:Module (NoMethodError)
    from /usr/local/rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:235:in `load'
    from /usr/local/rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:235:in `block in load'
    from /usr/local/rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:225:in `block in load_dependency'
    from /usr/local/rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:596:in `new_constants_in'
    from /usr/local/rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:225:in `load_dependency'
    from /usr/local/rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:235:in `load'
    from /usr/local/rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.5/lib/rails/engine.rb:201:in `block (2 levels) in <class:Engine>'
    from /usr/local/rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.5/lib/rails/engine.rb:200:in `each'
    from /usr/local/rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.5/lib/rails/engine.rb:200:in `block in <class:Engine>'
    from /usr/local/rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.5/lib/rails/initializable.rb:25:in `instance_exec'
    from /usr/local/rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.5/lib/rails/initializable.rb:25:in `run'
    from /usr/local/rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.5/lib/rails/initializable.rb:50:in `block in run_initializers'
    from /usr/local/rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.5/lib/rails/initializable.rb:49:in `each'
    from /usr/local/rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.5/lib/rails/initializable.rb:49:in `run_initializers'
    from /usr/local/rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.5/lib/rails/application.rb:134:in `initialize!'
    from /usr/local/rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.5/lib/rails/application.rb:77:in `method_missing'
    from /home/aaron/dev/onlinescheduler/config/environment.rb:5:in `<top (required)>'
    from /usr/local/rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `require'
    from /usr/local/rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `block in require'
    from /usr/local/rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:225:in `block in load_dependency'
    from /usr/local/rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:596:in `new_constants_in'
    from /usr/local/rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:225:in `load_dependency'
    from /usr/local/rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `require'
    from /home/aaron/dev/onlinescheduler/config.ru:3:in `block in <main>'
    from /usr/local/rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.1/lib/rack/builder.rb:46:in `instance_eval'
    from /usr/local/rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.1/lib/rack/builder.rb:46:in `initialize'
    from /home/aaron/dev/onlinescheduler/config.ru:1:in `new'
    from /home/aaron/dev/onlinescheduler/config.ru:1:in `<main>'
    from /usr/local/rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.1/lib/rack/builder.rb:35:in `eval'
    from /usr/local/rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.1/lib/rack/builder.rb:35:in `parse_file'
    from /usr/local/rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.1/lib/rack/server.rb:162:in `app'
    from /usr/local/rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.1/lib/rack/server.rb:248:in `wrapped_app'
    from /usr/local/rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.1/lib/rack/server.rb:213:in `start'
    from /usr/local/rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.5/lib/rails/commands/server.rb:65:in `start'
    from /usr/local/rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.5/lib/rails/commands.rb:30:in `block in <top (required)>'
    from /usr/local/rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.5/lib/rails/commands.rb:27:in `tap'
    from /usr/local/rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.5/lib/rails/commands.rb:27:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'

5 个解决方案

#1


3  

It will be better if you add

如果你加上去会更好

group :development do
  gem :mongrel
end

Cause you dont need it in production

因为你在生产中不需要它

#2


1  

You need to add gem "mongrel" to your Gemfile and run bundle install

您需要将gem“mongrel”添加到Gemfile并运行bundle安装

#3


1  

Just remember that when you add gem "mongrel" to the Gemfile, you'll need to specify:

请记住,当您将gem“mongrel”添加到Gemfile时,您需要指定:

gem "mongrel", "1.2.0.pre2"

Newer versions of mongrel are not compatible with Rails 3.

新版本的mongrel与Rails 3不兼容。

#4


0  

Alternatively, if you don't want mongrel, my understanding is that you can just comment out the offending line in new_rails_defaults.rb. The error message goes away for me when I do this.

或者,如果您不想要mongrel,我的理解是您可以注释掉new_rails_default .rb中的违规行。当我这样做时,错误信息就会消失。

#5


0  

Try usinggem install mongrel --pre

尝试使用gem安装mongrel -pre

It worked for me!!!

它为我工作! ! !

#1


3  

It will be better if you add

如果你加上去会更好

group :development do
  gem :mongrel
end

Cause you dont need it in production

因为你在生产中不需要它

#2


1  

You need to add gem "mongrel" to your Gemfile and run bundle install

您需要将gem“mongrel”添加到Gemfile并运行bundle安装

#3


1  

Just remember that when you add gem "mongrel" to the Gemfile, you'll need to specify:

请记住,当您将gem“mongrel”添加到Gemfile时,您需要指定:

gem "mongrel", "1.2.0.pre2"

Newer versions of mongrel are not compatible with Rails 3.

新版本的mongrel与Rails 3不兼容。

#4


0  

Alternatively, if you don't want mongrel, my understanding is that you can just comment out the offending line in new_rails_defaults.rb. The error message goes away for me when I do this.

或者,如果您不想要mongrel,我的理解是您可以注释掉new_rails_default .rb中的违规行。当我这样做时,错误信息就会消失。

#5


0  

Try usinggem install mongrel --pre

尝试使用gem安装mongrel -pre

It worked for me!!!

它为我工作! ! !