rails 未在生产中上传的字形
rails glyphicons not uploaded in production
我在 rails 4 应用程序中上传生产中的字形图标时遇到问题。
像这样的解决方案so question不适合我。
我的 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错误
为什么 glyphicons 在 rails 的生产模式下不加载?
我已将 bootstrap-sass
gem 从 3.3.5
降级到 3.3.0.1
并且字形按预期工作。
已更新: 更新 gem 'sass-rails', '>= 5.0.0'
与此 issue 对应,现在 glypicons 可以在 bootstrap-sass
版本中按预期工作gem3.3.5
我在 rails 4 应用程序中上传生产中的字形图标时遇到问题。
像这样的解决方案so question不适合我。
我的 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错误
为什么 glyphicons 在 rails 的生产模式下不加载?
我已将 bootstrap-sass
gem 从 3.3.5
降级到 3.3.0.1
并且字形按预期工作。
已更新: 更新 gem 'sass-rails', '>= 5.0.0'
与此 issue 对应,现在 glypicons 可以在 bootstrap-sass
版本中按预期工作gem3.3.5