2016-05-30 8 views
0

私はRubyアプリケーションでMontserratフォントを使用しています。私のデスクトップでは、フォントが表示されますが、私は他のPCでチェックして、それは時々新しいローマ字です。rails:フォントは生産現場には表示されません

私はapplication.rbでこれを追加しました:

config.assets.paths << Rails.root.join("app", "assets", "fonts") 
config.assets.precompile << /\.(?:svg|eot|woff|ttf)$/ 

と私のフォントは、資産/フォント/モントセラトにあります。

enter image description here

、これは

@font-face { 
    font-family: 'Montserrat'; 
    font-weight: normal; 
    font-style: normal; 
    src: font-url('montserrat/montserrat-regular-webfont.eot'); 
    src: font-url('montserrat/montserrat-regular-webfont.eot?#iefix') format('embedded-opentype'), 
    font-url('montserrat/montserrat-regular-webfont.woff') format('woff'), 
    font-url('montserrat/montserrat-regular-webfont.ttf') format('truetype'), 
    font-url('montserrat/montserrat-regular-webfont.svg') format('svg'); 
} 
私font.scssです

と私はこのようなフォントを呼び出します:

.welcome{ 
    font-family: 'Montserrat'; 
    color: #333; 
    text-align: center; 
} 

何が間違っていますか?

+0

サイドノート:WOFFを使用している場合、ttf/otfは必要ありません。 SVFFのフォントはひどいので放棄されていて、WOFFのために 'eot'が駄目になっているので、これらの異なる書式(感謝すべきことに2012年)は必要なく、WOFFを使用して複雑さを軽減します。詳細については、http://stackoverflow.com/a/37091681/740553 –

+0

を参照してください。ちょうどwoffのURLが必要ですか? – terrorista

+0

少なくとも、現在のWebをサポートする点では、WOFFリソースだけが必要であり、他のものは必要ありません。そして、あなたの 'scss'ではあなたはwoffのurlしか必要としません。 –

答えて

0

"bundle exec rake assets:preocompile RAILS_ENV = production"を実行し、次にgit add/git commitを実行して、新しいコミットをプロダクションにプッシュする必要があります。

+0

その同じ:/ – terrorista

関連する問題