Automatically Precompile Assets Before Pushing to Heroku

Automatically precompile assets before pushing to Heroku

I finally figured this out. I was indeed on the Cedar stack. The problem was that I had checked my public directory into Git, and when I pushed to Heroku, it realized that public existed, and thus assumed I precompiled. Running git rm -r public and adding public/** to my .gitignore, then pushing, fixes the problem.

Is it possible to skip the asset precompile step for a single git push on Heroku?

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.

Removing Precompiled Assets in Rails before Push to Heroku

Follow these steps:

rake assets:clean
git add .
git commit -m commit_name
git push heroku branch_name

This will clean your assets locally + pushing on heroku would precompile the assets.



Related Topics



Leave a reply



Submit