Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ActiveAdmin - uninitialized constant AdminUser

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.

like image 451
Benji Lanyado Avatar asked Jun 03 '13 20:06

Benji Lanyado


1 Answers

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

like image 112
andreofthecape Avatar answered Sep 26 '22 00:09

andreofthecape