【发布时间】:2018-12-15 21:28:32
【问题描述】:
希望得到一些帮助。我有一个 Rails 项目,在生产中似乎没有编译字体。
在我的 application.rb 文件中
class Application < Rails::Application
config.assets.paths << Rails.root.join("app", "assets", "fonts")
end
将字体添加到我的 scss 文件中,例如
@font-face {
font-family: 'Jaapokki';
src: asset-url("/assets/Jaapokki-Regular.eot");
src: asset-url("/assets/Jaapokki-Regular.eot?#iefix")
format("embedded-opentype"), asset-url("/assets/Jaapokki-Regular.woff") format("woff"), asset-url("/assets/Jaapokki-Regular.ttf") format("truetype");
font-weight: normal;
font-style: normal;
}
但在
的 chrome 开发控制台中出现错误GET https://mve.herokuapp.com/assets/Jaapokki-Regular.woff net::ERR_ABORTED
现在这在开发中有效,我在部署到 aws 服务器时使用了类似的设置。然而,这个应用程序部署到 heroku,这似乎给我带来了问题。我想第一个问题是如何检查我的字体在推送到生产时是否正在编译。
非常感谢任何帮助!
【问题讨论】:
标签: ruby-on-rails