I’m working on a small rails engine with I have turned into a gem. In order to manage the database I want to use ActiveAdmin.
I’ve added ActiveAdmin to my list of gem dependencies, and when I install the gem in my application I copy the active_admin initializer to config/initializers/ in the project which is using the gem.
However – for some reason this makes the application fail with the error:
uninitialized constant ActiveAdmin
If I add “activeadmin” to the projects Gemfile it run great – but that’s wrong and I don’t understand why I need to do that. I want my gem to be as isolated as possible.
Any help is welcome.
You might need to manually require activeadmin from your gem’s railtie (Rails 3.x) or initializer (Rails 2.x). Also it might be wise to move your config/initializers/active_admin.rb to engine as well. Something like this for Rails 3.x (put it into lib/my_gem/engine.rb)