Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Rails 4, font-awesome not appearing in production environment #74
My app is running just fine in development mode, but when I
I'm at a bit of a loss to know how to debug this, so any suggestions gratefully received. Relevant extracts from my Gemfile:
Happy to provide any other details, but I don't which which ones are relevant and I don't want to waste folks' time by essentially posting the entire project!
Notes after finding and reading #65 :
Output from bundler as follows:
Thanks for your help. The Capistrano output shows:
So I think that, yes, I am running the asset precompilation in production mode.
I reviewed the issue submission guidelines, and as far as I can see I'm following them. Diagnostic steps 1-3 don't apply, as my app works in development mode, so it's not an application source code issue. I confirm I've checked steps 4-6. Output from step 7 is in the earlier comment.
Investigating this a bit more this morning, I think the core issue is that in production my app is not rooted at
The HTTP get on
Is there a configuration option I should be setting somewhere to generate the appropriate URLs?
This was the exact problem I was having, and it was because I was also deploying to an app which root was not at
The fix for this was mindblowingly silly:
I say it's silly because I already have this in my application.rb:
So majority of the assets were picking up the ENV, but the font-awesome-rails gem, and some other various aftermarket things were NOT prepending it to the lookup path.
I don't think it's a problem with the gem? But I just finally figured this out on 12/27 after fighting with this issue for like off and on for two weeks - so don't have too much more info, but just wanted to pass this along.
@ephemerian and @superscott Thanks for the follow-up on this. This added info is really helpful.
I think it's safe to close this issue out, so I'm going to do that. If anyone wants to add a pull-request to add something about this to the readme, I'd be glad to pull that in too.
added a commit
May 8, 2014
referenced this issue
Nov 8, 2015
I have never needed to do this before and all Rails apps are running on the same server. Following font-awesome-rails README "Deploying to sub-folders" section fixed the "404 Not Found fontawesome-webfont..." issues on production server. This is for a Rails 5.1.4 application.