ActiveAdmin - uninitialized constant AdminUser

Benji Lanyado picture Benji Lanyado · Jun 3, 2013 · Viewed 13.7k times · Source

I'm getting an error while trying to run my app, having recently installed ActiveAdmin. It was working fine, but, after idling for a while, suddenly it isn't!

In my gem file:

gem 'activeadmin'

In my routes:

  devise_for :admin_users, ActiveAdmin::Devise.config

  ActiveAdmin.routes(self) 

And in my admin_user.rb

ActiveAdmin.register AdminUser do     
  index do                            
    column :email                     
    column :current_sign_in_at        
    column :last_sign_in_at           
    column :sign_in_count             
    default_actions                   
  end   etc....

The error when trying to run:

NameError: uninitialized constant AdminUser
~/Desktop/Sites/Fleetnation/app/admin/admin_user.rb:1:in `<top (required)>'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.11/lib/active_support/inflector/methods.rb:230:in `block in constantize'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.11/lib/active_support/inflector/methods.rb:229:in `each'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.11/lib/active_support/inflector/methods.rb:229:in `constantize'
...

Anyone got any ideas? Would be much appreciated.

Answer

andreofthecape picture andreofthecape · Jun 3, 2013

Try restarting rails server. Had similar problems which cleared up after a restart.