ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -


i using activeadmin , have file doing this:

activeadmin.register role something--- end

however, server gives me error:

runtimeerror: circular dependency detected while autoloading constant role /library/ruby/gems/2.0.0/gems/activesupport-4.0.10/lib/active_support/dependencies.rb:461:in `load_missing_constant' /library/ruby/gems/2.0.0/gems/activesupport-4.0.10/lib/active_support/dependencies.rb:184:in `const_missing' ~/desktop/boxfox/app/admin/role.rb:1:in `<top (required)>' /library/ruby/gems/2.0.0/gems/activesupport-4.0.10/lib/active_support/dependencies.rb:424:in `load' /library/ruby/gems/2.0.0/gems/activesupport-4.0.10/lib/active_support/dependencies.rb:424:in `block in load_file' /library/ruby/gems/2.0.0/gems/activesupport-4.0.10/lib/active_support/dependencies.rb:616:in `new_constants_in' /library/ruby/gems/2.0.0/gems/activesupport-4.0.10/lib/active_support/dependencies.rb:423:in `load_file' /library/ruby/gems/2.0.0/gems/activesupport-4.0.10/lib/active_support/dependencies.rb:324:in `require_or_load' /library/ruby/gems/2.0.0/gems/activesupport-4.0.10/lib/active_support/dependencies.rb:463:in `load_missing_constant' /library/ruby/gems/2.0.0/gems/activesupport-4.0.10/lib/active_support/dependencies.rb:184:in `const_missing' /library/ruby/gems/2.0.0/gems/activesupport-4.0.10/lib/active_support/inflector/methods.rb:226:in `const_get' /library/ruby/gems/2.0.0/gems/activesupport-4.0.10/lib/active_support/inflector/methods.rb:226:in `block in constantize' /library/ruby/gems/2.0.0/gems/activesupport-4.0.10/lib/active_support/inflector/methods.rb:224:in `each' /library/ruby/gems/2.0.0/gems/activesupport-4.0.10/lib/active_support/inflector/methods.rb:224:in `inject' /library/ruby/gems/2.0.0/gems/activesupport-4.0.10/lib/active_support/inflector/methods.rb:224:in `constantize' /library/ruby/gems/2.0.0/gems/activesupport-4.0.10/lib/active_support/core_ext/string/inflections.rb:66:in `constantize' /library/ruby/gems/2.0.0/gems/rolify-3.4.1/lib/rolify/configure.rb:47:in `block in sanity_check' /library/ruby/gems/2.0.0/gems/rolify-3.4.1/lib/rolify/configure.rb:46:in `each' /library/ruby/gems/2.0.0/gems/rolify-3.4.1/lib/rolify/configure.rb:46:in `sanity_check' /library/ruby/gems/2.0.0/gems/rolify-3.4.1/lib/rolify/configure.rb:7:in `configure' ~/desktop/boxfox/config/initializers/rolify.rb:1:in `<top (required)>' 

ah took me while solve issue: go directory app/admin/...

make sure file names in plural not singular, example:

it should videos.rb not video.rb

or let's in case roles.rb not role.rb

i found solution here: https://github.com/activeadmin/activeadmin/issues/2334 @phallstrom


Comments

Popular posts from this blog

javascript - Wordpress slider, not displayed 100% width -

c++ - OpenMP unpredictable overhead -