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
Safe Navigation Equivalent to Rails Try for Hashes
Change HTML Form Id Generated by Form_For Rails 3.1
What Grammar Based Parser-Generator Tools Exist for Ruby
How to Transfer Files Using Ssh and Scp Using Ruby Calls
Solving the Travelling Salesman Problem in Ruby (50+ Locations)
How to Detect the End of a Method Chain in Ruby
Map an Array Modifying Only Elements Matching a Certain Condition
Wicked-Pdf Not Showing Images, 'Wicked_Pdf_Image_Tag' Undefined
Adding a "Like/Unlike" Button to a Post in Rails
How to Install a Gem Globally Without Sudo Using Rbenv
Ruby Gems in Stand-Alone Ruby Scripts
Rails 4 Update Nested Attributes
Is There a Function Like String#Scan, But Returning Array of Matchdatas