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

前端 未结 14 1700
自闭症患者
自闭症患者 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:39

    For all those who are reading this but do not have problem with application.css and instead with their custom CSS classes e.g. admin.css, base.css etc.

    Solution is to use as mentioned

    bundle exec rake assets:precompile
    

    And in stylesheets references just reference application.css

    <%= stylesheet_link_tag    "application", :media => "all" %>
    

    Since assets pipeline will precompile all of your stylesheets in application.css. This also happens in development so using any other references is wrong when using assets pipeline.

提交回复
热议问题