1

我能够在 Rails 4 中手动设置 Bootstrap 3,但字形图标除外,我无法在生产中使用资产管道。所以我决定尝试宝石。我正在使用 anjlab 的 gem。

在我的 Gemfile 中,我添加了:

gem 'anjlab-bootstrap-rails', :require => 'bootstrap-rails',
                              :github => 'anjlab/bootstrap-rails'

一切都在开发中完美运行。当我推动生产时,字形图标不显示。在生产中正确创建了 glyphicon 资产。引导程序否则有效。我的日志中没有错误。我怎样才能找出问题出在哪里?

编辑:我切换到 gem 'bootstrap-sass-rails' 并且遇到了同样的问题。

4

1 回答 1

0

我将 tbhis 添加到我的 bootstrap.css.scss 之后:@import 'twitter/bootstrap';

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

于 2013-12-11T11:08:03.050 回答