Finally, I was able to solve this problem. In case someone else runs into this problem, I thought I would document the steps I took to solve this problem.
I ran my application locally in production mode ( RAILS_ENV=production rails s
) and was able to duplicate the error I received on Heroku on my local machine.
I copied my active_admin.css.scss and active_admin.js to the / vendor / assets directory. As the y app
kept telling me that it lacked active_admin / mixins, I also copied the entire active_admin directory into the assets in the vendor / assets directory. I'm not sure if this is necessary or not.
From Herokuโs point of view, they told me, but I canโt confirm that production.rb is not read during pre-compilation, so all settings must be defined in application.rb. So, I made sure that I had the following settings in application.rb -
#Added to fix devise/active admin issue ? config.assets.initialize_on_precompile = false
I found most of the tips above around the web (on stackoverflow, heroku, github, etc.). The part I did not see was the need to make changes to Bundler.require in application.rb from:
Bundler.require(*Rails.groups(:assets => %w(development test)))
to:
Bundler.require(:default, :assets, Rails.env)
Once I made these changes, I could push the code to Heroku and let it pre-assemble the assets for me. Hope this helps someone save time on resolving this issue.
source share