资产路径中缺少指纹 [英] missing fingerprints in asset paths
问题描述
我们刚刚使用新的资产管道部署了Rails 3.1应用程序.在开发中,一切看起来都很好,但是在生产中,所有资产图像都丢失了. 部署时,我们遵循了Ruby on Rails Edge Guide.例如,来自我们应用程序的一个简单代码段:
We just deployed a Rails 3.1 app using the new asset pipeline. In Development everything looks fine, but in production all asset-images are missing. When deploying we followed the Ruby on Rails Edge Guide. As an example, a simple code snippet from our app:
asset_path "favicon.png", "images"
这会在生产中产生:
/assets/favicon.png
但是指纹丢失了(因此在生产中是一个死链接).我们已经尝试了不带图像"的情况,而是使用了image_tag
.什么都没用.
But the fingerprint is missing (and therefore it is a deadlink on production). We already tried it without the "images", with image_tag
instead. Nothing is working.
其他信息:
- Rails版本3.1.0
已经查看并尝试过:
- https://github.com/rails/rails/issues/1209
- Rails 3.1 and Image Assets
- Rails 3.1 Asset Pipeline and Caching
推荐答案
The recent Railscast Episode #282 covered switching assets from 3.0 to 3.1 with asset pipeline. Have you already tried setting config.assets.digest = true
in config/environments/production.rb?
这篇关于资产路径中缺少指纹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!