13

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.

4
  • 1
    Yea, I've done that to no avail. Still got the old stuff up Commented May 17, 2011 at 0:07
  • Are you pushing the master branch? Commented May 17, 2011 at 0:16
  • Yes I am. When I do git push heroku master, it keeps returning Everything up-to-date even though everything isn't up to date Commented May 17, 2011 at 0:19
  • 2
    I came here looking for the solution to this problem. In my case, most of my CSS changed but not a few recent selectors. It turned out I had ran rake assets:precompile before making those changes. I ran rake assets:precompile again to include them, then committed and pushed to Heroku. Hope this helps someone. Commented Dec 8, 2011 at 18:28

5 Answers 5

43

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
Sign up to request clarification or add additional context in comments.

Comments

14

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

1 Comment

That worked perfectly. I completely forgot about committing changes. Thanks for your help!
3

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.

Comments

2

If you have recently deleted a css file, you should also use 'git rm' to ensure that it has been removed from your repository. Otherwise heroku may still use it.

Comments

0

Reviving an old thread, but I got here having the same issue so I think it's still relevant to others. Check that the .css file is not simply cached by the browser you're testing on. By re-visiting the site in incognito mode you will be able to tell if a cached file is masking the changes.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.