Closed ChrisSki closed 10 years ago
@ChrisSki can you check if that commit fixes your issues? 43cba5591371a9f56a56d95a42e8327a3852faf3
I strongly believe that vendor/assets/fonts
is the appropiate location for these files, so even though app/assets
will work out of the box I wouldn't want to put them there if it isn't stritcly necessary.
It would be great if you could give me some feedback if the change worked for you, then I can release a new version of the gem.
Thanks for the issue report.
This was not a heroku issue, for me. Locall, in production mode, with precompiled assets, i had to add
config.assets.precompile << /\.(?:svg|eot|woff|ttf)$/
to application.rb
My icon render from vendor/assets/fonts. Great gem, thank you.
Glad you like the gem @dinshaw
So is the commit above improving the situation for you or is it a problem in any way?
The above line fixes everything for me. After running fontello convert
, everything works fine in dev, but the fonts are not in the asset path after a deploy to Heroku.
I was able to reproduce locally by running rake assets:precompile RAILS_ENV=production; rails s -e production
.
The fix above adds the fonts to the compiled assets, and both my scenarios worked perfectly.
@dinshaw, https://github.com/railslove/fontello_rails_converter/commit/43cba5591371a9f56a56d95a42e8327a3852faf3 should fix your problem as it contains the fix you mention. could you try loading the gem with:
gem 'fontello_rails_converter', github: 'railslove/fontello_rails_converter', require: nil
and running bundle update fontello_rails_converter
. then it should work on Heroku without having to set
config.assets.precompile << /\.(?:svg|eot|woff|ttf)$/
in application.rb
.
Tried that and it did not fix the issue.
The require: nil
in the above gemfile line means the config change will not do anything.
If you remove the require: nil
, it does work.
For my money, i'd rather leave the gem in group :development
and add the config line myself.
Less magic, less prod gems to worry about down the road.
+1 from me, imho gems shouldn't mess with Rails internals. so revert https://github.com/railslove/fontello_rails_converter/commit/43cba5591371a9f56a56d95a42e8327a3852faf3 and add the config to the readme. what do you think @jhilden?
I just released a new version of the gem 0.2.0
including the Railtie integration (43cba55). I believe that gems should work out of the box if possible. And this is the only way that we can update this configuratoin if rails should change at some point.
I would however, gladly take a README pull request, telling people they can also add the gem to their :development
group and add the necessary production config themselves.
I'm closing this now. Please let me know if there are any issues left.
I tried a number of things that did not work. I ended up with having to move the fonts to my app/assets directory for them to work on Heroku.
Per Heroku, I am using the
rails_12factor
gem and haveconfig.serve_static_assets = true
inproduction.rb
Any insight into this? Or should this gem be installing the font folder in the app directory?