Rails production static files routing error

前端 未结 2 807
独厮守ぢ
独厮守ぢ 2020-12-17 14:02

When I run my app locally in test/dev my views come up nicely and everything is happy. When I try to navigate to those same erb files running on my remote server/local produ

相关标签:
2条回答
  • 2020-12-17 14:39

    In Rails5, you should comment

    "config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?" 
    

    in config/enviroment/production.rb

    0 讨论(0)
  • 2020-12-17 14:55

    Are you using Rails 3? By default Rails 3 / webrick does not serve static files in production mode. You can easily enable this by setting

    config.serve_static_assets to true in your production.rb file.

    0 讨论(0)
提交回复
热议问题