Question

I'm running Rails 4 with the 'twitter-bootstrap-rails' gem (2.0.5) and some reason beyond me glyphicons appear solely as squares. The rest of bootstrap seems to be working fine. I've tried adding font-awesome directly but to no appeal. Any ideas on what cause bootstrap to function fully with the exception of glyphicons?

group :development do
 gem 'better_errors'
 gem 'binding_of_caller'
 gem 'meta_request'
 gem 'twitter-bootstrap-rails'
end
group :assets do 
 gem 'twitter-bootstrap-rails'
end
#for the sake of redundancy
gem 'font-awesome-rails'
Was it helpful?

Solution

Well I managed to resolve this with

    *= require font-awesome

in my css file but am still confused as to why the twitter-bootstrap functioned with only the exception of the icons.

OTHER TIPS

My issue is a bit different than yours, but I'm still adding an answer in case anyone encounters this issue in future.

In my case all glyphicons used to work when I used bootstrap-sass version 3.0.3.0. After updating to bootstrap-sass 3.3.7, some glyphicons were displayed properly, others were displayed as squares.

There were 2 issues:

  1. I had to add @import "bootstrap-sprockets"; line to application.css.scss file (it seems it's required after 3.3 version, and it wasn't required before)
  2. I had to update rails-sass version to 5.0 from 4.0

FYI: I use 4.1.0 rails version

Confusingly for me, I didn't get an error about invalid sass version until I had explicitly set the version of bootstrap-sass to 3.3.7. Previously bundler chose this version automatically, and it didn't bother the bundler that the rails-sass version was incompatible. This sounds like something that couldn't happen, maybe I'm wrong about this last paragraph. I'm not a Ruby expert, I don't know if a bundler is capable of making such mistakes.

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