Rails 4指纹识别在生产环境中导致404 for bootstrap资产

 JieGe木 发布于 2023-01-06 02:03

bootstrap-sass在我的Rails 4应用程序中使用了gem,我使用了Glpyphicons字体,它包含了我的应用程序中的图标引导程序.在开发过程中,这些图标显示得很好.但是,在任何非开发环境中,每次对Glyphicon字体文件的引用都会出现404错误.

我已经确定这是由于资产管道打破了Bootstrap样式表中的引用所做的指纹识别.

Bootstrap引用这些字体:

@font-face {
  font-family: 'Glyphicons Halflings';
  src: url("bootstrap/glyphicons-halflings-regular.eot");
  src: url("bootstrap/glyphicons-halflings-regular.eot?#iefix") format("embedded-opentype"), url("bootstrap/glyphicons-halflings-regular.woff") format("woff"), url("bootstrap/glyphicons-halflings-regular.ttf") format("truetype"), url("bootstrap/glyphicons-halflings-regular.svg#glyphicons_halflingsregular") format("svg");
}

但是,快速ls的bootstrap文件夹显示名称不同.

glyphicons-halflings-regular-293ade90ddeb5ceccd08b9b32ae97010.eot
glyphicons-halflings-regular-533d84fb5d3948367e1b51dde3a08b39.svg
glyphicons-halflings-regular-d381f367f3f48c9f7f775a043238f0f8.ttf
glyphicons-halflings-regular-e5b007f195d752fa4823febe5e66ef4e.woff

如您所见,每个文件都附加了指纹.

删除这些指纹可以解决问题.但是,手动执行此操作并不适合部署.有没有人有这方面的解决方案?bootstrap-sass如果可以帮助我,我想避免编辑gem代码.

谢谢!

撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有