4

So I Installed the font-awesome gem and everything looks good, using the latest version etc. Also included in my application.css:

*= require font awesome

When I view from local it turns out fine and the glyph-icons show up. When I upload it to heroku, the icons do not show up. I originally had the block squares show up but managed to fix it as I had some messy code in my stylesheets.

What am I doing wrong or what am I missing?

luke
  • 1,513
  • 2
  • 20
  • 38
  • sorry if this seems silly, but did you make sure that the font-awesome gem is listed as a requirement in your project's Gemfile? It sounds like heroku can't find the gem for some reason, and the most obvious reason I can think of would be that it is missing in the Gemfile – Moritz Jan 31 '14 at 08:28
  • @Moritz I made sure that the gem is listed. Precompiled and everything before deploying also. I think it is something to do with the asset pipeline but I can't figure out where I have gone wrong with it because everything "looks" ok. gonna dig a little deeper today – luke Jan 31 '14 at 15:19

1 Answers1

2

Had the same issue and resolved it (in Rails 4) using info from the following two sources: Rails Asset Pipeline and Rails Asset Pipeline for Heroku

"With the asset pipeline, the preferred location for these assets is now the app/assets directory". Move the fonts folder for font-awesome into app/assets and the font awesome js and css files into vendor/assets or app/assets appropriate javascripts and stylesheets folders.

Now you need to compile the assets for production, run:

$ rake assets:precompile
$ RAILS_ENV=production bundle exec rake assets:precompile
$ git add public/assets
$ git commit -m "vendor compiled assets"

Then push to heroku

$ git push heroku master

Hopefully this helps someone else who stumbles upon this question.

Laser
  • 5,085
  • 4
  • 34
  • 48