bnzelener
bnzelener

Reputation: 223

Removing Precompiled Assets in Rails before Push to Heroku

I have a Heroku app on Rails 4.0.8.

At some point early on, I realized that my CSS and JS changes wouldn't push to Heroku unless I ran rake assets:precompile and committed the new asset files before pushing (git push heroku master).

I've been doing those asset precompiles for about 14 months now, and I've amassed over 48mb in what appear to be old precompiled assets. However, when I remove them from public/assets manually, my site loses all of its CSS and JS.

How do I remove the old precompiled assets and get Heroku to start compiling on push?

Upvotes: 1

Views: 3188

Answers (2)

Awais Shafqat
Awais Shafqat

Reputation: 546

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.

Upvotes: 9

Dheeresha
Dheeresha

Reputation: 797

Try the following code.

rake assets:clean

Upvotes: 4

Related Questions