0

I have trouble with uploading glyphicons in production in my rails 4 app.

Solutions like this so question not working for me.

My application.css.scss file contain this lines:

@import "bootstrap-sprockets";
@import "bootstrap";
$icon-font-path: "bootstrap/";

It's right path on production to glyphicons fonts in application.css file, for example:

url("/assets/bootstrap/glyphicons-halflings-regular-8cd45fc682c0e3a2695ce9453750efec.woff2") format("woff2")

I try to download this file(mydomain.com/assets/bootstrap/glyphicons-halflings-regular-8cd45fc682c0e3a2695ce9453750efec.woff2) and I've downloaded it, that mean that files stores in servers in the right directory. And in my browser I don't see 404 errors.

But I noticed one thing, that confused me, locally I can see that glyphicons fonts downloaded:

enter image description here

And in production I don't see that file in network tab:

enter image description here

And there are no js errors

Why glyphicons doesn't load in production mode in rails?

Community
  • 1
  • 1
Igor Biryukov
  • 270
  • 4
  • 15
  • Have you taken a look at: http://stackoverflow.com/questions/10905905/using-fonts-with-rails-asset-pipeline , you may need to add the font file extensions to the precompile list. – danielrsmith Aug 12 '15 at 21:18
  • @danielrsmith on server it stored precompiled fonts in directory my_app/public/assets/bootstrap and I can download it, my problem is that fonts don't uploaded font file in browser even with right path for fonts(with digest) in css rules and I don't know why. – Igor Biryukov Aug 13 '15 at 09:16
  • Hmmm, normally I use https://github.com/twbs/bootstrap-sass instead, since it make this process super easy and doesn't clog your repo with vendor code. – danielrsmith Aug 13 '15 at 16:44

1 Answers1

0

I've downgraded bootstrap-sass gem from 3.3.5 to 3.3.0.1 and glyphicons work as expected.

Updated: update gem 'sass-rails', '>= 5.0.0' correspond with this issue and now glypicons works as expected with version of bootstrap-sass gem 3.3.5

Igor Biryukov
  • 270
  • 4
  • 15