files produced by asset:precompile don't match urls generated by stylesheet_link_tag (missing digest) in minimal rails 4 site

后端 未结 2 1112
面向向阳花
面向向阳花 2020-12-31 09:54

I\'m using Ruby 2.0.0-p247 and Rails 4.0.0

If I make a minimal Rails 4 site like this:

rails new minimal
cd minimal
rails g         


        
2条回答
  •  情歌与酒
    2020-12-31 10:41

    While I was writing up this question I came across this blog post which suggests it is a bug.

    http://railsblog.kieser.net/2013/08/rails4-phusion-passenger-asset-pipeline.html

    Of the various suggestions, just setting the compilation fallback true...

    config.assets.compile = true
    

    seems to be sufficient to kick Rails in to generating appropriately digested URLs:

    
    
    

    The other suggestion, explicitly setting RAILS_ENV and RAILS_GROUPS seemed to produce different digest strings on the precompiled files, but they always seem to match up with the generated HTML regardless.

提交回复
热议问题