未初始化的常量RailsAdmin :: Config :: HasDescription(NameError)

时间:2014-09-10 12:23:33

标签: ruby-on-rails ruby rails-admin

我在Rails Admin gem上做了一个捆绑更新 - 现在当我尝试启动rails服务器时它显示以下错误:

/Users/nirav/.rvm/gems/ruby-2.0.0-p353@railstutorial_rails_4_0/gems/rails_admin-0.6.3/lib/rails_admin/config/sections/base.rb:16:in `<class:Base>': uninitialized constant RailsAdmin::Config::HasDescription (NameError)
from /Users/nirav/.rvm/gems/ruby-2.0.0-p353@railstutorial_rails_4_0/gems/rails_admin-0.6.3/lib/rails_admin/config/sections/base.rb:10:in `<module:Sections>'
from /Users/nirav/.rvm/gems/ruby-2.0.0-p353@railstutorial_rails_4_0/gems/rails_admin-0.6.3/lib/rails_admin/config/sections/base.rb:8:in `<module:Config>'
from /Users/nirav/.rvm/gems/ruby-2.0.0-p353@railstutorial_rails_4_0/gems/rails_admin-0.6.3/lib/rails_admin/config/sections/base.rb:7:in `<module:RailsAdmin>'
from /Users/nirav/.rvm/gems/ruby-2.0.0-p353@railstutorial_rails_4_0/gems/rails_admin-0.6.3/lib/rails_admin/config/sections/base.rb:6:in `<top (required)>'
from /Users/nirav/.rvm/gems/ruby-2.0.0-p353@railstutorial_rails_4_0/gems/rails_admin-0.6.3/lib/rails_admin/config/sections/list.rb:1:in `<top (required)>'
from /Users/nirav/.rvm/gems/ruby-2.0.0-p353@railstutorial_rails_4_0/gems/rails_admin-0.6.3/lib/rails_admin/config.rb:2:in `<top (required)>'
from /Users/nirav/.rvm/gems/ruby-2.0.0-p353@railstutorial_rails_4_0/gems/rails_admin-0.6.3/lib/rails_admin/config/model.rb:1:in `<top (required)>'
from /Users/nirav/.rvm/gems/ruby-2.0.0-p353@railstutorial_rails_4_0/gems/rails_admin_nestable-0.2.0/lib/rails_admin_nestable.rb:7:in `<top (required)>'
from /Users/nirav/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
from /Users/nirav/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
from /Users/nirav/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each'
from /Users/nirav/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require'
from /Users/nirav/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
from /Users/nirav/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
from /Users/nirav/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
from /Users/nirav/Projects/app-name/config/application.rb:7:in `<top (required)>'
from /Users/nirav/.rvm/gems/ruby-2.0.0-p353@railstutorial_rails_4_0/gems/railties-4.0.2/lib/rails/commands.rb:74:in `require'
from /Users/nirav/.rvm/gems/ruby-2.0.0-p353@railstutorial_rails_4_0/gems/railties-4.0.2/lib/rails/commands.rb:74:in `block in <top (required)>'
from /Users/nirav/.rvm/gems/ruby-2.0.0-p353@railstutorial_rails_4_0/gems/railties-4.0.2/lib/rails/commands.rb:71:in `tap'
from /Users/nirav/.rvm/gems/ruby-2.0.0-p353@railstutorial_rails_4_0/gems/railties-4.0.2/lib/rails/commands.rb:71:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'

这是我的rails_admin.rb(初始化程序)

http://pastebin.com/GEPvBqca

任何想法如何解决这个问题?

提前致谢。

更新1 - 这是我的routes.rb:

http://pastebin.com/4UGqjnD1

以下是routes.rb的摘要:

  devise_for :admins

  mount RailsAdmin::Engine => '/admin', as: 'rails_admin'
  mount RailsAdminImport::Engine => '/rails_admin_import', :as => 'rails_admin_import'

  devise_for :users

  root :to => redirect('/admin')

1 个答案:

答案 0 :(得分:0)

试试这个:

devise_for :admins
mount RailsAdmin::Engine => '/rails_admin', :as => 'rails_admin' 

我不确定,但我希望它对您有用...不要忘记重新启动服务器..