Rails Stylesheets on Heroku

前端 未结 2 903
长情又很酷
长情又很酷 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:48

    Instead of checking in compiled assets into Git, first read this: https://devcenter.heroku.com/articles/ruby-support#plugin-injection-in-rails-4

    You can either add this gem

    gem 'rails_12factor'

    or add this gem specifically

    rails_serve_static_assets

    or manually change the config in config/environments/production.rb

    config.serve_static_assets = true

提交回复
热议问题