Question

I have a rails app that I developed on my local machine using the gem bootstrap-sass. It all worked fine in development, but when I deployed my app to the production server the glyphicons stopped working.

There's an error in the console that says:

 downloadable font: download failed (font-family: "Glyphicons Halflings" style:normal 
 weight:normal stretch:normal src index:1): status 2147746065 
 source: http://mydomain.com/assets/bootstrap/glyphicons-halflings-regular.woff

And indeed there is no such file, but the same file with an asset pipeline digest. So it seems to me the request to the asset pipeline file is broken and therefore tries to get the normal file? Or is my asset pipeline broken? Not really sure. And not really sure why it works on my local machine but not on the server.

Do I have to configure my production.rb differently?

# Compress JavaScripts and CSS.
config.assets.js_compressor = :uglifier
# config.assets.css_compressor = :sass

# Do not fallback to assets pipeline if a precompiled asset is missed.
config.assets.compile = false

# Generate digests for assets URLs.
config.assets.digest = true

# Version of your assets, change this if you want to expire all your assets.
config.assets.version = '1.0'
Was it helpful?

Solution

Setting config.assets.compile to true is not the best solution, considering performance stuff.

You may want to try RAILS_ENV=production bundle exec rake assets:precompile and restart server.

OTHER TIPS

solved it by setting

config.assets.compile = true
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top