Assets precompile not being run on heroku cedar for rails 3.2 app Assets precompile not being run on heroku cedar for rails 3.2 app heroku heroku

Assets precompile not being run on heroku cedar for rails 3.2 app


This seems to be solved now. I believe it was caused by the Rakefile not loading the assets:precompile task in production.

The rakefile was loading up tasks for both the cucumber and rspec gems which are not bundled into production. As a result the assets:precompile task was not available in production so heroku didn't attempt to run it.

I wrapped the test tasks in a environment check conditional like so:

if %(development test).include?(Rails.env)  require 'rspec/core'  require 'rspec/core/rake_task'end


If there's anything wrong in your Rakefile then the precompile step will be skipped entirely. For me, I was referring to a dependency that was only being loaded in my test and development environments and not production so the rakefile was bombing.

Using the suggestion from @Lecky-Lao worked for me.

heroku run rake -T --app staging-hawkmoRunning `rake -T` attached to terminal... up, run.1rake aborted!cannot load such file -- jasmine-headless-webkit

Once I saw that it was as simple as wrapping the Rakefile require in an environment test.


I normally add this to production.rb:

# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)config.assets.precompile += %w( style.css grid.css ... geo.js jquery.flexslider-min.js)

and set:

config.assets.compile = false