Situation: I am facing an issue with my Rails 4.0.0 application deployed using capistrano, where the asset precompilation does not work properly on my production server.
Challenge: Despite successfully adding a font and using it with @font-face locally, the feature fails to function as expected in the production environment.
Error Notification: Upon inspection, the error message received is: "Failed to load resource: the server responded with a status of 404 (Not Found) "
The fonts are stored within app/assets/fonts/
Pertinent Files:
app/assets/stylesheets/application.css.scss:
/*
* This is a manifest file yada yada yada...
*
*= require bootstrap
*= require_self
*= require_tree .
*/
@font-face {
font-family: 'stone_sansregular';
src: url(font-path('stone_sans_regular-webfont.eot') + "?#iefix") format('embedded-opentype'),
url(font-path('stone_sans_regular-webfont.woff')) format('woff'),
url(font-path('stone_sans_regular-webfont.ttf')) format('truetype'),
url(font-path('stone_sans_regular-webfont.svg') + "#stone_sansregular") format('svg');
}
config/application.rb:
config.assets.paths << Rails.root.join("app", "assets", "fonts")
Despite numerous attempts and research on Stack Overflow and other platforms, I have been unable to rectify the issue. It's important to note that I am not deploying on Heroku. Can anyone provide insight into what could be missing? Your assistance is greatly appreciated.
UPDATE: In the production environment, I have located the fonts in the directory: my-rails-app/current/public/@assets/fonts