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

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

    After all else failed...

    My solution was to change the layout file from

    = stylesheet_link_tag "reset-min", 'application'
    

    to

    = stylesheet_link_tag 'application'
    

    And it worked! (You can put the reset file inside the manifest.)

    0 讨论(0)
  • 2020-11-27 09:44

    OK - I had the same problem. I didn't want to use "config.assets.compile = true" - I had to add all of my .css files to the list in config/environments/production.rb:

    config.assets.precompile += %w( carts.css )
    

    Then I had to create (and later delete) tmp/restart.txt

    I consistently used the stylesheet_link_tag helper, so I found all the extra css files I needed to add with:

    find . \( -type f -o -type l \) -exec grep stylesheet_link_tag {} /dev/null \;
    
    0 讨论(0)
提交回复
热议问题