The following errors appears when I try to run rails console in production. (In development mode it works as expected)
bin$ RAILS_ENV=production ./rails c
/home/ubuntu/app/shared/vendor/bundle/ruby/2.3.0/gems/activesupport-5.1.7/lib/active_support/dependencies.rb:509:in `load_missing_constant': Circular dependency detected while autoloading constant AdminUser (RuntimeError)
My AdminUser contains the following:
class AdminUser < ApplicationRecord
devise :database_authenticatable,
:recoverable, :rememberable, :trackable, :validatable
end
It'll be more helpful if you can post code for AdminUser
check your code (AdminUser) for circular references like
1: callback triggering the same callback (update self after update)
2: method calling the same method
Pluralizing all the controllers under /admin fixed this issue
https://github.com/activeadmin/activeadmin/issues/2334#issuecomment-42626409
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.