Heroku not updating css for rails app

后端 未结 5 2049
春和景丽
春和景丽 2021-02-04 08:14

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

相关标签:
5条回答
  • 2021-02-04 09:02

    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
    
    0 讨论(0)
  • 2021-02-04 09:02

    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.

    0 讨论(0)
  • 2021-02-04 09:03

    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.

    0 讨论(0)
  • 2021-02-04 09:09

    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.

    0 讨论(0)
  • 2021-02-04 09:13

    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
    
    0 讨论(0)
提交回复
热议问题