Every time I deploy my Rails 3.2 project to Heroku, rake assets:precompile
is run:
$ git push heroku master
...
----> Preparing app for Rails asset pipeline
Running: rake assets:precompile
Asset precompilation completed (189.17s)
...
Sometimes I want to make a push that I know does not change any assets, such as a quick hotfix to a controller. Is it possible to skip the asset:precompile step for a single git push to Heroku?
Thanks.
To compile your assets locally, run the assets:precompile task locally on your app. Make sure to use the production environment so that the production version of your assets are generated. A public/assets directory will be created. Inside this directory you'll find a manifest.
The clean it removes the old versions of the precompiled assets while leaving the new assets in place. Show activity on this post. rake assets:clean removes compiled assets. It is run by cap deploy:assets:clean to remove compiled assets, generally from a remote server.
Sure! You'll need to create a manifest.yml
in your_app/pubilc/assets
directory.
The file can be blank. But ideally, you precompile everything locally, so deploys to Heroku would be much faster.
Make sure that you also committed the manifest.yml
file when you're pushing to Heroku. Something like git add -f your_app/pubilc/assets/manifest.yml
and a git push heroku master
should suffice.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With