Rails 6 Font.Не удалось загрузить ресурс: Suast_Ornad сервер ответил со статусом 404 (не найден) - PullRequest
0 голосов
/ 24 сентября 2019

Эй, у меня возникла эта проблема при развертывании моего приложения на heroku, оно отлично работает на локальном компьютере, но по какой-то причине не при развертывании.У меня есть этот шрифт, который я скачал с dafont.com, и он не отображается, когда я открываю приложение в heroku.вот application.scss

 @font-face {
  font-family: "Suast Ornad";
  src: url(asset-path('suastornad.ttf')) format("truetype");
}

config / application.rb

module BogSite
  class Application < Rails::Application
    # Initialize configuration defaults for originally generated Rails version.
    config.assets.paths << Rails.root.join("app", "assets", "fonts")
    config.load_defaults 5.0

    # Settings in config/environments/* take precedence over those specified here.
    # Application configuration can go into files in config/initializers
    # -- all .rb files in that directory are automatically loaded after loading
    # the framework and any gems in your application.
  end
end

, а вот шрифт, вызываемый внутри файла scss:

.banner-text div {
    color: white;
    font-family: 'Suast Ornad';
    font-size: 60px;
    padding-top: 15px;
}
      <div class="banner-text text-center">
        <%= content_tag(:div, @title)%>
      </div>
...