I have some problems with bootstrap glyphicons font on staging env with rails. The server could find font files before, just recent the server suddenly could not find those font files after deploying with capistrano on staging (I am pretty sure I have not made any changes on config files, the only changes are js files and some ui to prof that I rolled back to last working revision but glyphicons still cannot show up).
By looking through log files, I found out the precompile is working properly.
The assets precompile will create several font files in the directory /public/assets/bootstrap/
names are:
glyphicons-halflings-regular-<digest>.eot
glyphicons-halflings-regular-<digest>.woff2
glyphicons-halflings-regular-<digest>.svg
glyphicons-halflings-regular-<digest>.svg.gz
glyphicons-halflings-regular-<digest>.woff
glyphicons-halflings-regular-<digest>.ttf
I also start server up and login to the page with glyphicons. By looking through "Network" tab in browser console. I found 404 error:
.../assets/bootstrap/glyphicons-halflings-regular.woff2
I realise server could not find *.woff2 files because of server not finding the correct name (missing <digest>
) glyphicons-halflings-regular-<digest>.woff2
I searched and tried a lot of methods but still not working. A guy on stackoverflow is asking the same question: fontawesome icons with twitter-bootstrap-rails doesn't show on staging environment
But my rails version is 4.1.6 aready
ruby: 1.9.3
gem 'bootstrap-sass', '=3.3.6' # the latest version under ruby 2.0
gem 'sass', '>=3.4.7'# the latest version working with bootstrap-sass
gem 'sass-rails', '>=5.0.0.beta1'
Thanks for helping me.