我最近从 Rails 3 应用程序迁移到 4 时遇到了这个问题。我在升级的其他应用程序上没有看到这个错误。
启动服务器时出现此错误。devise_for :users
我意识到当路线存在时出现错误routes.rb
。
知道是什么导致了这个错误以及如何解决它吗?
/Users/user/.rvm/gems/ruby-2.0.0-p247@mysite/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:10:in `rescue in execute_if_updated': Rails::Application::RoutesReloader#execute_if_updated delegated to updater.execute_if_updated, but updater is nil: #<Rails::Application::RoutesReloader:0x007fc453039b10 @paths=["/Users/user/Sites/mysite/config/routes.rb"], @route_sets=[#<ActionDispatch::Routing::RouteSet:0x007fc4531562a0>]> (RuntimeError)
from /Users/user/.rvm/gems/ruby-2.0.0-p247@mysite/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:6:in `execute_if_updated'
from /Users/user/.rvm/gems/ruby-2.0.0-p247@mysite/gems/railties-4.0.0/lib/rails/application/finisher.rb:69:in `block in <module:Finisher>'
from /Users/user/.rvm/gems/ruby-2.0.0-p247@mysite/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/user/.rvm/gems/ruby-2.0.0-p247@mysite/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `run'
from /Users/user/.rvm/gems/ruby-2.0.0-p247@mysite/gems/railties-4.0.0/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/user/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:150:in `block in tsort_each'
from /Users/user/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
from /Users/user/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:219:in `each_strongly_connected_component_from'
from /Users/user/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:182:in `block in each_strongly_connected_component'
from /Users/user/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:180:in `each'
from /Users/user/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:180:in `each_strongly_connected_component'
from /Users/user/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:148:in `tsort_each'
from /Users/user/.rvm/gems/ruby-2.0.0-p247@mysite/gems/railties-4.0.0/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/user/.rvm/gems/ruby-2.0.0-p247@mysite/gems/railties-4.0.0/lib/rails/application.rb:215:in `initialize!'
from /Users/user/.rvm/gems/ruby-2.0.0-p247@mysite/gems/railties-4.0.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /Users/user/Sites/mysite/config/environment.rb:8:in `<top (required)>'
from /Users/user/.rvm/gems/ruby-2.0.0-p247@mysite/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
from /Users/user/.rvm/gems/ruby-2.0.0-p247@mysite/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `block in require'
from /Users/user/.rvm/gems/ruby-2.0.0-p247@mysite/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency'
from /Users/user/.rvm/gems/ruby-2.0.0-p247@mysite/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
from /Users/user/Sites/mysite/config.ru:3:in `block in <main>'
from /Users/user/.rvm/gems/ruby-2.0.0-p247@mysite/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
from /Users/user/.rvm/gems/ruby-2.0.0-p247@mysite/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
from /Users/user/Sites/mysite/config.ru:in `new'
from /Users/user/Sites/mysite/config.ru:in `<main>'
from /Users/user/.rvm/gems/ruby-2.0.0-p247@mysite/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval'
from /Users/user/.rvm/gems/ruby-2.0.0-p247@mysite/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string'
from /Users/user/.rvm/gems/ruby-2.0.0-p247@mysite/gems/rack-1.5.2/lib/rack/builder.rb:40:in `parse_file'
from /Users/user/.rvm/gems/ruby-2.0.0-p247@mysite/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config'
from /Users/user/.rvm/gems/ruby-2.0.0-p247@mysite/gems/rack-1.5.2/lib/rack/server.rb:199:in `app'
from /Users/user/.rvm/gems/ruby-2.0.0-p247@mysite/gems/railties-4.0.0/lib/rails/commands/server.rb:48:in `app'
from /Users/user/.rvm/gems/ruby-2.0.0-p247@mysite/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app'
from /Users/user/.rvm/gems/ruby-2.0.0-p247@mysite/gems/railties-4.0.0/lib/rails/commands/server.rb:75:in `start'
from /Users/user/.rvm/gems/ruby-2.0.0-p247@mysite/gems/railties-4.0.0/lib/rails/commands.rb:78:in `block in <top (required)>'
from /Users/user/.rvm/gems/ruby-2.0.0-p247@mysite/gems/railties-4.0.0/lib/rails/commands.rb:73:in `tap'
from /Users/user/.rvm/gems/ruby-2.0.0-p247@mysite/gems/railties-4.0.0/lib/rails/commands.rb:73:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'