Ruby on rails 4 rails 4,字体在开发中可以,但在生产中不能

Ruby on rails 4 rails 4,字体在开发中可以,但在生产中不能,ruby-on-rails-4,fonts,assets,Ruby On Rails 4,Fonts,Assets,我读了很多关于在Rails 4中使用自定义字体的帖子,不同的方法,我找不到一种方法使其在开发和生产模式中都很好 在开发模式下,我将字体添加到特定文件夹“et line”中 app/assets/fonts/ |_ et-line |_ et-line.eot |_ et-line.svg |_ et-line.ttf |_ et-line.woff 在我的“优雅的.css”文件中,我添加了以下条目 @font-fac

我读了很多关于在Rails 4中使用自定义字体的帖子,不同的方法,我找不到一种方法使其在开发和生产模式中都很好

在开发模式下,我将字体添加到特定文件夹“et line”中

app/assets/fonts/
   |_ et-line
       |_ et-line.eot
       |_ et-line.svg
       |_ et-line.ttf
       |_ et-line.woff
在我的“优雅的.css”文件中,我添加了以下条目

        @font-face {
        font-family: 'et-line';
        src: url('/assets/et-line/et-line.eot');
        src: url('/assets/et-line/et-line.eot?#iefix') format('embedded-opentype'), 
        url('/assets/et-line/et-line.woff') format('woff'), 
        url('/assets/et-line/et-line.ttf') format('truetype'), 
        url('/assets/et-line/et-line.svg#et-line') format('svg');
        font-weight: normal;
        font-style: normal;
        }
这在开发中运行良好。。。我会显示字体图标。。 但在投入生产时,资源没有加载

编译后的application.css包含:

@font-face {
font-family: 'et-line';
src: url("/assets/et-line/et-line.eot");
src: url("/assets/et-line/et-line.eot?#iefix") format("embedded-opentype"), url("/assets/et-line/et-line.woff") format("woff"), url("/assets/et-line/et-line.ttf") format("truetype"), url("/assets/et-line/et-line.svg#et-line") format("svg");
font-weight: normal;
font-style: normal
}

显然,/fonts/文件夹已丢失。。。 但是,如果我将它添加到我的grateate.css文件中。。。那么它在开发模式下就不工作了

正确的书写是什么/资产,/assets/font/?只有另一种方式


感谢您的启发…

如果您还没有解决此问题,请查看其他soSO帖子。找到答案的Rails 4部分->我在上写了一个诊断和解决这个问题的通用方法。