Question

I was able to set up Bootstrap 3 in Rails 4 manually with the exception of the glyphicons, which I could not get to work with the assets pipeline in production. So I decided to try a gem. I am using anjlab's gem.

In my Gemfile, I added:

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

Everything works perfectly in development. When I push to production the glyphicons do not display. The glyphicon assets are being created correctly in production. Bootstrap otherwise works. I am getting no errors in my log. How can I figure out where the problem is?

Edit: I switched to gem 'bootstrap-sass-rails' and have the same problem.

Was it helpful?

Solution

I added tbhis to my bootstrap.css.scss, after: @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") }

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top