In development the fonts load correctly from path: lib/assets/plugins/global/fonts
however in production I get a 404 file not found for fonticon icons.
Note: bootstrap-icons load correctly in production and the paths match in plugins.bundle.css
Is there a place in the settings.yml where the font has to be loaded/listed?
In the generated file, the fonts are referenced at url("fonts/something.ttf"). But rails does not know to look there, and thus, does not find them. So it converts the path to "/fonts/something.ttf", which 404s.
We had to explicitly let rails / sprockets know that it could look in that directory to find the font assets:Rails.application.config.assets.paths < Rails.root.join("lib", "assets", "plugins", "global")
Note: this comment box will not allow me to use the correct syntax for inject. Be sure to use two less than characters
Hi
Glad you have resolved it. Hope that your solution can help others as well.
Thanks
I am using Capistrano gem for Rails production environment. I got it figured out by moving the fonticon.css file to lib/assets/css and changing the file path in the css to and moving the fonts to custom/fonts/fonticon/{all fonts}.
Now icons bundle in asset pipeline as expected in production env.
Hi
Do you mean you build the assets using the gulp --prod
option?
Thanks