ActiveAdmin - uninitialized constant AdminUser

I get an error when I try to start my application by recently installing ActiveAdmin. It worked fine, but after a long downtime, suddenly it is not!

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.... 

Error trying to start:

 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' ... 

Does anyone have any idea? It would be very grateful.

+5
ruby-on-rails nameerror activeadmin
Jun 03
source share
3 answers

Try restarting the rail server. There were similar problems that were fixed after a reboot.

+7
Jun 03 '13 at 21:18
source share

This error will be called at any time when your model has an erroneous connection. If you change any associations, but forget to update the model file, you will get this error.

Double check model files. Open the active administrator locally to find out what error he is giving you (localhost: 3000 / admin). Usually it says uninitialized constant MyModel:MyBadAssociation , so it helps you diagnose the error.

+4
Jun 22 '14 at 0:00
source share

It helped me rename the application / models / admin _user.rb to app / models / admin_users.rb.

-2
Sep 24 '13 at
source share



All Articles