资产路径中缺少指纹(missing fingerprints in asset paths)

编程入门 行业动态 更新时间:2024-10-28 19:24:11
资产路径中缺少指纹(missing fingerprints in asset paths)

我们刚刚使用新的资产管道部署了一个Rails 3.1应用程序。 在开发中,一切看起来都很好,但在生产中,所有资产图像都缺失。 在部署时,我们遵循Ruby on Rails边缘指南。 例如,我们的应用程序中的一个简单代码段:

asset_path "favicon.png", "images"

这在生产中产生:

/assets/favicon.png

但指纹缺失(因此它是生产的死链接)。 我们已经尝试过没有“图像”,而是使用image_tag 。 没有什么工作。

附加信息:

Rails版本3.1.0

已经看过并尝试过:

https://github.com/rails/rails/issues/1209 Rails 3.1和图像资产 Rails 3.1资产管道和缓存

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"

This generates in production:

/assets/favicon.png

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.

Additional Information:

Rails Version 3.1.0

Already looked at and tried:

https://github.com/rails/rails/issues/1209 Rails 3.1 and Image Assets Rails 3.1 Asset Pipeline and Caching

最满意答案

最近的Railscast第282集涉及利用资产管道将资产从3.0转换为3.1。 您是否已尝试在config / environments / production.rb中设置config.assets.digest = true ?

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?

更多推荐

本文发布于:2023-07-30 11:50:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1337859.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:指纹   路径   资产   missing   asset

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!