rails - application.css asset not found in production mode

前端 未结 4 1760
夕颜
夕颜 2021-01-31 16:38

I\'m upgrading an application to use the asset pipeline.

I\'ve got the css assets compiling into an application css file but they not being found when I run the applicat

4条回答
  •  轮回少年
    2021-01-31 17:07

    In Rails 4, you can get them to show in production (running locally), by passing an environment variable:

    RAILS_SERVE_STATIC_FILES=true rails server -e production

    This should work as long as you have this line in /config/environments/production.rb:

    config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?

提交回复
热议问题