我在本地使用的 Heroku 网站的背景图像有问题
background-image: url('background_stripe.png');
有效,但部署后文件已损坏
我尝试过使用
background-image: image-url('background_stripe.png');
background-image: url(image-url('background_stripe.png'));
background-image: url(image_url('background_stripe.png'));
其中没有一个在本地或 Heroku 上工作。
使用bash我发现heroku已将图像文件命名为background_stripe.png,但它没有散列并且是损坏的图像
在你的 Production.rb 中添加以下行
config.serve_static_assets = true
config.assets.compile = true
或者您可以尝试使用本地预编译资产
RAILS_ENV=production rake assets:precompile
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)