【问题标题】:Rails 4 Fonts not rendering after precompile in production on Apache在 Apache 上的生产中预编译后,Rails 4 字体未呈现
【发布时间】:2014-05-02 04:09:38
【问题描述】:

我在app/assets/fonts/myfont.TTF 中有一个字体。这在开发中运行良好,但是当我使用 phusion 乘客在 Apache 上部署时,并且在预编译资产后,它没有被加载。

以下是相关的CSS

@font-face
{
  font-family: 'myfont';
  src: url('/assets/myfont.TTF');
}

【问题讨论】:

  • 你需要将 "url('/assets/myfont.TTF')" 替换为 "asset-url('myfont.TTF')" 来告诉 Rails 编译你的字体。

标签: css ruby-on-rails apache fonts


【解决方案1】:

作为 Kengo 国家,你需要改变

url('/assets/myfont.TTF')

asset-url('myfont.TTF')

你只是在路径语法中有一个错误

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-12-15
    • 2014-02-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多