Rails アプリケーションの stylesheets フォルダーにフォント用のファイルを 1 つ作成しました。
@font-face {
font-family: 'MuseoSans500';
src: url("<%= asset_path('museosans_500-webfont.eot?')%>") format('embedded-opentype');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'MuseoSans500';
src: url("<%= asset_path('museosans_500-webfont.woff')%>") format('woff'),
url("<%= asset_path('museosans_500-webfont.ttf')%>") format('truetype'),
url("<%= asset_path('museosans_500-webfont.svg#MuseoSans500')%>") format('svg');
font-weight: normal;
font-style: normal;
}
アセットをプリコンパイルすると、style.css.erb ページでエラーが発生します。パスのスプロケットを追跡して、このファイルを取得しました。エラーは
paths subpath /home/new_app/app/assets/stylesheets/app-theme/themes/default/style.css.erb
rake aborted!
undefined method `[]' for nil:NilClass
(/home/hbror/applications/survey/app/assets/stylesheets/application.css 内)