Rails 4: Why are fonts not loading in production?

后端 未结 5 911
轻奢々
轻奢々 2020-12-01 10:59

I can\'t load fonts in my Rails 4 app in production, it works normally in development.

Assets are precompiled on the server while deploying.

I have my fonts

5条回答
  •  感动是毒
    2020-12-01 11:25

    1:- Keep all your fonts on app/assets/fonts folder.

    2:- After rake asset:precompile RAILS_ENV=production all your fonts will get precompiled to public/assets folder with a digest.

    3:- Instead of using src: url('fontname.eot') use src: font_url('fontname.eot') in scss files.

提交回复
热议问题