Typicons字体没有在heroku中显示

我在我的rails应用程序中使用typicons和heroku并且它在本地工作但不在生产中,我在heroku中没有得到任何路由错误,我不确定我缺少什么。 我在资源文件夹中有一个字体文件夹,我正在使用

config.assets.paths << Rails.root.join("app", "assets", "fonts") 

在我的应用程序类下的config.application.rb文件中。

在typicons.css.scss里面(在stylesheets文件夹中)我有

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

我在同一个问题上花了几个小时。 以下是对我有用的:

assets/fonts放置字体文件

在typicons.css.scss(在stylesheets文件夹中)里面,我有:

 /* @FONT-FACE loads font into browser */ @font-face { font-family: 'typicons'; font-weight: normal; font-style: normal; src: font-url(asset-path('typicons.eot')); src: font-url(asset-path('typicons.eot?#iefix')) format('embedded-opentype'), font-url(asset-path('typicons.woff')) format('woff'), font-url(asset-path('typicons.ttf')) format('truetype'), font-url(asset-path('typicons.svg#typicons')) format('svg'); } 

在application.rb中,我添加了:

 config.assets.precompile << /\.(?:svg|eot|woff|ttf)$/ 

最后,在提交并推送到Heroku之前,我运行了以下命令:

 RAILS_ENV=production bundle exec rake assets:precompile 

没有将以下行添加到application.rb:

 config.assets.paths << Rails.root.join("app", "assets", "fonts") 

如果在Rails控制台中运行Rails.application.class.config.assets.paths ,您应该能够看到Rails是否正在拾取assets / fonts目录。 在Rails 4.2.5中,fonts目录自动添加到资源路径。

希望这能节省一些时间。