-
Notifications
You must be signed in to change notification settings - Fork 242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rails 4, font-awesome not appearing in production environment #74
Comments
Notes after finding and reading #65 :
Output from bundler as follows:
|
When you precompile your assets, are you running it with RAILS_ENV=production?
Also, please follow the Issue submission guidelines that we have. It will help us debug your issue a little better. |
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. |
I can confirm that this solution works. I've put together some quick notes in pull request #76 |
Yes, yes, yes! This issue has been driving me wonky. The solution was: Awesome. Thank you so much for posting this conversation publicly! |
rake assets:precompile RAILS_ENV=production |
|
In my case had to do |
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. |
My app is running just fine in development mode, but when I
cap deploy
to my production environment (EC2, as it happens, though I'm not sure how significant that is), the app can't resolve the font-awesome font. I'm using pretty much as-installed rails environment configurations, and Capistrano recipes. Everything else in the app runs just fine, it's only the font-awesome font that can't be found.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!
The text was updated successfully, but these errors were encountered: