Make Font Awesome from twitter-bootstrap-rails work with Rails 4
Taken from this comment by ewollesen:
Just to be super clear, if using Rails 4:
$ cd RAILS_ROOT
$ mkdir -p vendor/assets/fonts
$ cp `bundle show twitter-bootstrap-rails`/vendor/assets/fonts/fontawesome-webfont.* \
vendor/assets/fonts
Then in config/application.rb, add:
config.assets.precompile += ["fontawesome-webfont.ttf",
"fontawesome-webfont.eot",
"fontawesome-webfont.svg",
"fontawesome-webfont.woff"]
Written by Michel Billard
Related protips
2 Responses
my fonts reside in app/assets/font
and my config/application is as
config.assets.paths += ["#{config.root}/app/assets/font", "#{config.root}/app/assets/images/", "#{config.root}/vendor/assets/images"]
config.assets.precompile += %w(*.png *.jpg *.jpeg *.gif *.eot *.svg *.ttf *.otf *.woff vendor/assets/stylesheets//* app/assets/font/*)
fonts load perfectly in dev env but when assets are precompiled and production env is run, they dont work
over 1 year ago
·
My solution was to move all vendors fonts to public/fonts folder. So there is no need to precompile fonts.
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Fontawesome
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#