This problem may be caused by the fact that Rails resources cannot precompile the url() function in the CSS file.
Since your font files are precompiled by assets, all URLs point to these files, they must be rewritten into an MD5-digested file name. Unfortunately, Rails cannot automatically precompile url() , at least I think so, because I checked some cases and got this output :) In the Rails manual, Rails provides these functions using ERB and Sass. see here .
I think there are two ways to solve your problem.
First install the directory in .bowerrc - public/components and use them manually without requiring them in your assets.
Secondly, I suggest using font-url() instead of url() in Font-Awesome, so your application.css.scss will look like this:
@font-face { font-family: 'FontAwesome'; src: font-url('font-awesome/fonts/fontawesome-webfont.eot?v=4.0.3'); src: font-url('font-awesome/fonts/fontawesome-webfont.eot?#iefix&v=4.0.3') format('embedded-opentype'), font-url('font-awesome/fonts/fontawesome-webfont.woff?v=4.0.3') format('woff'), font-url('font-awesome/fonts/fontawesome-webfont.ttf?v=4.0.3') format('truetype'), font-url('font-awesome/fonts/fontawesome-webfont.svg?v=4.0.3#fontawesomeregular') format('svg'); font-weight: normal; font-style: normal; }
Override the font path with your actual font path and font using font-url() , this function is provided by sass-rails. After the precompilation you will see that your URL has been rewritten to /assets/font-awesome/fonts/fontawesome-webfont-50b448f878a6489819d7dbc0f7dbfba0.eot?v=4.0.3 or something like public/assets/application-xxxxxx.css .
You can find the same approach in various gems that include assets, like bootstrap-sass, which is a very popular gem. read this file: _glyphicons.scss . You will see:
@font-face { font-family: 'Glyphicons Halflings'; src: font-url('#{$icon-font-path}#{$icon-font-name}.eot'); src: font-url('#{$icon-font-path}#{$icon-font-name}.eot?#iefix') format('embedded-opentype'), font-url('#{$icon-font-path}#{$icon-font-name}.woff') format('woff'), font-url('#{$icon-font-path}#{$icon-font-name}.ttf') format('truetype'), font-url('#{$icon-font-path}#{$icon-font-name}.svg#glyphicons_halflingsregular') format('svg'); }
url() been replaced. So I think rewriting @font-face in application.css.scss is the easiest way :)
By the way, bootstrap and font-awesome both have @font-face . I don't know if a font is needed.
When accessing the page, the correct log is displayed. Therefore, you do not need to change any code in the repositories. Hope this helps.