Open crissmancd opened 6 years ago
edit: I thought we were having the same problem, but now I'm not sure. The fonts are precompiling for me, but they're compiling with the wrong paths, and so the app isn't finding them. Inspecting the http requests shows the app looking for the assets at a path with an additional asset prefix prepended for me. If you see in your traffic inspector that this isn't happening for you, disregard my comments below.
I was/am having the same problem. Still working on the proper rails solution, but I was able to hot-fix my app by making the following modifications to font-awesome-rails-4.7.0.4/app/assets/stylesheets/font-awesome.css.erb (removing use of font_path, essentially):
src: url('<%= font_path('fontawesome-webfont.eot') %>');
src: url('<%= font_path('fontawesome-webfont.eot') %>?#iefix') format('embedded-opentype'), url('<%= font_path('fontawesome-web font.woff2') %>') format('woff2'), url('<%= font_path('fontawesome-webfont.woff') %>') format('woff'), url('<%= font_path('fontaweso me-webfont.ttf') %>') format('truetype'), url('<%= font_path('fontawesome-webfont.svg') %>#fontawesomeregular') format('svg');
becomes:
src: url('<%= 'fontawesome-webfont.eot' %>');
src: url('<%= 'fontawesome-webfont.eot' %>?#iefix') format('embedded-opentype'), url('<%= 'fontawesome-webfont.woff2' %>') format( 'woff2'), url('<%= 'fontawesome-webfont.woff' %>') format('woff'), url('<%= 'fontawesome-webfont.ttf' %>') format('truetype'), url(' <%= 'fontawesome-webfont.svg' %>#fontawesomeregular') format('svg');$
Hope this is of some help.
I'm looking into the use of the font_path variable to avoiding needing to modify the gem code, and will post the solution if I find it.
We experienced this issue too. I've documented it elsewhere. Please let me know if you're interested in having me put the screenshots describing the problem here.
In the end, we decided to remove this gem and use the Font Awesome CDN.
My solution was download font awesome 4.7 and copy/paste the css and font files.
It appears that the font files are not being precompiled in production. The css files work, but fonts are not found. These are the rails/sass gems installed:
I've added this to assets.rb:
Rails.application.config.assets.precompile += %w( *.tt *woff *.woff2 *.svg *.eot )
Does anything need to be added to the assets manifest file? Not sure what I'm missing here.