【发布时间】:2013-10-24 22:22:48
【问题描述】:
我无法在生产中的 Rails 4 应用程序中加载字体,它在开发中正常工作。
部署时在服务器上预编译资产。
我有我的字体
app/assets/fonts
我的 app.css:
@font-face {
font-family: 'WalkwayBoldRegular';
src: url('Walkway_Bold-webfont.eot');
src: url('Walkway_Bold-webfont.eot?#iefix') format('embedded-opentype'),
url('Walkway_Bold-webfont.woff') format('woff'),
url('Walkway_Bold-webfont.ttf') format('truetype'),
url('Walkway_Bold-webfont.svg#WalkwayBoldRegular') format('svg');
font-weight: normal;
font-style: normal;
}
在我的 production.rb 我有:
config.assets.precompile << Proc.new { |path|
if path =~ /\.(eot|svg|ttf|woff)\z/
true
end
}
【问题讨论】:
-
你在使用 Heroku 吗?
-
ubuntu 12.04,不是heroku
-
好的,我有一个答案,但我们只在 Heroku 中使用过它,所以如果它不正确,请多多包涵
标签: ruby-on-rails fonts ruby-on-rails-4 capistrano font-face