安装设备后在rails中获取错误

时间:2013-08-06 17:26:01

标签: ruby-on-rails-4 ruby-2.0

我在为用户安装设备后出现此错误

C:3:in `rescue in execute_if_updated': Rails::Application::RoutesReloader#execut
e_if_updated delegated to updater.execute_if_updated, but updater is nil: #<Rail
s::Application::RoutesReloader:0x3900780 @paths=["C:/ror/wishlistize/config/rout
es.rb"], @route_sets=[#<ActionDispatch::Routing::RouteSet:0x393a140>]> (RuntimeE
rror)
        from C:131071:in `execute_if_updated'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/applic
ation/finisher.rb:69:in `block in <module:Finisher>'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/initia
lizable.rb:30:in `instance_exec'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/initia
lizable.rb:30:in `run'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/initia
lizable.rb:55:in `block in run_initializers'
        from C:/Ruby200/lib/ruby/2.0.0/tsort.rb:150:in `block in tsort_each'
        from C:/Ruby200/lib/ruby/2.0.0/tsort.rb:183:in `block (2 levels) in each
_strongly_connected_component'
        from C:/Ruby200/lib/ruby/2.0.0/tsort.rb:219:in `each_strongly_connected_
component_from'
        from C:/Ruby200/lib/ruby/2.0.0/tsort.rb:182:in `block in each_strongly_c
onnected_component'
        from C:/Ruby200/lib/ruby/2.0.0/tsort.rb:180:in `each'
        from C:/Ruby200/lib/ruby/2.0.0/tsort.rb:180:in `each_strongly_connected_
component'
        from C:/Ruby200/lib/ruby/2.0.0/tsort.rb:148:in `tsort_each'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/initia
lizable.rb:54:in `run_initializers'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/applic
ation.rb:215:in `initialize!'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/railti
e/configurable.rb:30:in `method_missing'
        from C:/ror/wishlistize/config/environment.rb:5:in `<top (required)>'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_
support/dependencies.rb:228:in `require'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_
support/dependencies.rb:228:in `block in require'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_
support/dependencies.rb:213:in `load_dependency'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_
support/dependencies.rb:228:in `require'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/applic
ation.rb:189:in `require_environment!'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/comman
ds.rb:45:in `<top (required)>'
        from bin/rails:4:in `require'
        from bin/rails:4:in `<main>'

我不确定它是否因为设计

这是我的路线文件

Wishlistize::Application.routes.draw do
  devise_for :users
end

和environment.rb

# Load the Rails application.
require File.expand_path('../application', __FILE__)

# Initialize the Rails application.
Wishlistize::Application.initialize!

当我运行rake db:migrate时,我得到了这个 用户模型:

class User < ActiveRecord::Base
  # Include default devise modules. Others available are:
  # :token_authenticatable, :confirmable,
  # :lockable, :timeoutable and :omniauthable
  devise :database_authenticatable, :registerable,
         :recoverable, :rememberable, :trackable, :validatable
end

1 个答案:

答案 0 :(得分:1)

好的,我想通了。根据我读过的教程,我实际上并没有rails g devise:install,而是直接rails g devise:user。这似乎导致了这个问题。我安装了边缘版本,很明显。