Making Font Awesome Work Within Rails 5
The easiest way to get Font Awesome to work is to use the CDN itself, which requires you to give them your email address.
But there may be times when you want to host it yourself. You can either use a gem, or if you prefer to have more control, you can download the zip from Font Awesome directly.
If you did the latter:
- Unzip the file and you’ll see a bunch of folders.
- Select the
cssfolder and copy it to
- Copy the folder
- Open your
application.cssand enter the line
*= require font-awesome.minsomewhere between the other require statements. There is no dependency for Font Awesome, but if your other css files depend on this, ensure that the Font Awesome’s require line is higher.
- Next, open
font-awesome.minin your favourite text editor.
- Replace all instances of
Restart your Rails server if needed. This should now work and you should no longer see any more RoutingError in your logs when the application is trying to find the font file.