Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Heroku not updating css for rails app

I'm having trouble updating my rails app on heroku. I've gotten my app up but I tried to change my application.css file in /public/stylesheets/ but whenever I try to push to heroku, the CSS never changes. I tested these changes locally and they work just fine, I just can't figure out how to push them to heroku. I've tried pushing with git push heroku, heroku db:push, and heroku rake db:migrate but nothing works. Thanks for your help.

like image 356
geitben Avatar asked May 16 '11 23:05

geitben


3 Answers

Each time you make changes on your CSS you need to run the following commands on the terminal:

$bundle exec rake assets:precompile
$git add . 
$git commit -m "msg" 
$git push heroku master
like image 163
Chleo Avatar answered Nov 16 '22 19:11

Chleo


Remember that you have to commit the changes locally before you can push them.

If you do a git status, it should be clean.

If it's not (my prediction):

git commit -am "Your commit message"
git push heroku master
like image 39
Jesse Wolgamott Avatar answered Nov 16 '22 20:11

Jesse Wolgamott


In my case it was because a previous developer had set up to do compiles locally instead of at deploy time. I had a manifest file that I needed to delete:

public/assets/manifest-<md5 hash>.json

Once I deleted that and pushed, heroku built my assets.

like image 3
Stephen Horvath Avatar answered Nov 16 '22 18:11

Stephen Horvath