Rails App Not Serving Assets in Production Environment

前端 未结 8 1996
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-01 01:29

My app works fine when run in development environment. In production (rails server -e production), the browser can\'t access the css and js files and on the con

8条回答
  •  我在风中等你
    2020-12-01 02:02

    in Rails 5.x the setting is

    config/initializers/assets.rb:

    Rails.application.config.public_file_server.enabled = true
    

    https://edgeguides.rubyonrails.org/configuring.html

提交回复
热议问题