我们刚刚使用新的资产管道部署了一个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.pngBut 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.0Already 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?
更多推荐
发布评论