我將應用程序部署到了生產環境中,並注意到圖像不是從image_tag提供的,但是如果使用asset_path則會提供圖像。我在app/assets/images下有我的圖片。在生產中,我預先編譯它們,以便它們處於公共/資產並具有名稱,如'image_name-fk3r23039423-0e9232.png'。未在生產中通過image_tag在Rails 4中投放圖像
當我看到HTML代碼生成我看到我的IMAGE_TAG的src是
/images/logo
而asset_path產生這樣的:
/assets/login-bg1-01eead5b47afcb7e0a951a3668ec3921e8df3f4507f70599f1b84d5efc971855.jpg
所以它是正確的。所以我很感興趣,爲什麼我不能使用image_tag'image-name'提供圖像?
這裏是我的production.rb
config.serve_static_files = true
config.assets.compile = false
config.assets.digest = true
我們在https://gitlab.com/gitlab-org/gitlab-ce/issues/28743 –