Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fails to push to Heroku: Sprockets::FileNotFound: could not find application.css

I used to be able to push to Heroku without problems. After making some changes, which seem unrelated to my problem, it fails to push to Heroku. On git push heroku I get the error:

...
remote: -----> Preparing app for Rails asset pipeline
remote:        Running: rake assets:precompile
remote:        rake aborted!
remote:        Sprockets::FileNotFound: could not find file: /tmp/build_c657fd7***e8c75a3/app/assets/stylesheets/application.css
remote:        /tmp/build_790d1e***cab4395/vendor/bundle/ruby/2.2.0/gems/sprockets-3.3.3/lib/sprockets/loader.rb:103:in `load_from_unloaded'
remote:        /tmp/build_790d1***ab4395/vendor/bundle/ruby/2.2.0/gems/sprockets-3.3.3/lib/sprockets/loader.rb:60:in `block in load'
...
remote:  !     Precompiling assets failed.
remote:  !     Push rejected, failed to compile Ruby app
remote:  !     Push rejected to ***.

application.css does exist in my development environment and includes:

 *= require_self
 *= require universal
 *= require bootstrap-datepicker3
 *= require menu_header
 *= require table
 *= require wice_grid
 *= require_tree .

Does anyone have an idea what might be causing the problems and what to do about it? If I can resolve it through resetting something, then that's an option since the application isn't live yet so there's no risk of losing data.

like image 494
Nick Avatar asked Sep 05 '25 17:09

Nick


2 Answers

I contacted Heroku and they described it as a slug cache issue. Clearing the cache using purge_cache solved it.

like image 70
Nick Avatar answered Sep 07 '25 11:09

Nick


According to researches there may be some options: 1) Just set config.serve_static_assets to true 2) make a rake assets:precompile before pushing , also see if you got any errors 3) .git file corrupted in git directory

like image 32
Joao Carlos Avatar answered Sep 07 '25 11:09

Joao Carlos