我无法在生产中的Rails 4应用程序中加载字体,它在开发过程中正常工作。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,所以请不错,如果它不正确 –