luke
luke

Reputation: 1578

Font Awesome working locally, but not on Heroku

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?

Upvotes: 4

Views: 2264

Answers (1)

Laser
Laser

Reputation: 5449

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.

Upvotes: 2

Related Questions