Rails Stylesheets on Heroku

前端 未结 2 859
长情又很酷
长情又很酷 2021-02-20 08:30

On my local machine, when I view my Rails App, my stylesheets are successfully linked at /assets/stylesheets/ but on Heroku, it is changed to /stylesheets/

2条回答
  •  青春惊慌失措
    2021-02-20 08:40

    Michael, I before you push to heroku try:

    rake assets:precompile

    This will precompile them in the public folder so that they can be served to Heroku. Let me know if that didn't work.

    Also, make sure the following line exists in config/environments/production.rb

    config.serve_static_assets = true
    

    Then of course

    git push heroku master

提交回复
热议问题