1
嗨我正在使用carrierwave,我使用默認圖像如下。Carrierwave默認圖片在Heroku中沒有顯示
def default_url
ActionController::Base.helpers.asset_path([version_name, "image.png"].compact.join('_'))
end
它在開發中工作正常,但圖像沒有在heroku中加載生產。
Image URL在生產和開發中顯示如下。
/assets/tiny_thumb_image.png
,但我在Heroku的控制檯檢查
puts helper.asset_path("small_thumb_image.png")
。輸出如下所示,包含在文件名中的指紋。
/assets/tiny_thumb_image-2372152cb18fd9aac1004f781047ee6a.png
我也包括
config.serve_static_assets = true
上傳到heroku後,這工作? – RGB