没有在生产中上载的rails glyphicons

问题描述 投票:0回答:1

我在Rails 4应用中无法在生产环境中上传glyphicons。

像这样的解决方案, 所以问题对我不起作用。

我的application.css.scss文件包含以下行:

@import "bootstrap-sprockets";
@import "bootstrap";
$icon-font-path: "bootstrap/";

这是生产application.css文件中的glyphicons字体的正确路径,例如:

url("/assets/bootstrap/glyphicons-halflings-regular-8cd45fc682c0e3a2695ce9453750efec.woff2") format("woff2")

我尝试下载此文件(mydomain.com/assets/bootstrap/glyphicons-halflings-regular-8cd45fc682c0e3a2695ce9453750efec.woff2),并且我已经下载了它,这意味着文件存储在服务器的正确目录中。 在我的浏览器中,我没有看到404错误。

但是我注意到一件事,这让我感到困惑,在本地我可以看到下载的glyphicons字体:

在此处输入图片说明

在生产环境中,我在“网络”标签中看不到该文件:

在此处输入图片说明

而且没有js错误

为什么在生产模式下无法在Rails中加载字形图标?

ruby-on-rails twitter-bootstrap glyphicons
1个回答
0
投票

我已经降级bootstrap-sass宝石从3.3.53.3.0.1和glyphicons正常工作。

更新:更新'sass-rails', '>= 5.0.0'与此问题相对应,现在glypicons可以正常使用bootstrap-sass gem 3.3.5

© www.soinside.com 2019 - 2024. All rights reserved.