rails 3.1.0 ActionView::Template::Error (application.css isn't precompiled)

前端 未结 14 1705
自闭症患者
自闭症患者 2020-11-27 09:02

I made a basic rails app with a simple pages controller with an index function and when I load the page I get:

ActionView::Template::Error (application.css i         


        
14条回答
  •  爱一瞬间的悲伤
    2020-11-27 09:38

    On heroku server (readonly filesystem), If you want runtime compilation of css (its not recommended but you can do it), make sure you have done settings like below -

    # inside config/application.rb
    config.assets.enabled = true
    config.assets.prefix = Rails.root.join('tmp/assets').to_s
    
    # If you are using sass then keep gem outside of asset group
     gem 'sass-rails',   '3.1.4'
    
    # inside config/environments/production.rb
    config.assets.compile = true
    

提交回复
热议问题