Rails不会预编译assets-fonts文件夹

时间:2018-10-05 01:11:43

标签: ruby-on-rails

我一直在应用程序上收到404,只是意识到它正在寻找一种字体:/assets/fonts/footable.woff

所以我认为我只是在fonts文件夹中创建app/assets文件夹,然后重新运行RAILS_ENV=production rake assets:precompile

我这样做了,当我对lspublic/assets/时,没有 still 没有fonts文件夹。

这是我的config/application.rb

module MyRailsApp
  class Application < Rails::Application
    # Initialize configuration defaults for originally generated Rails version.
    config.load_defaults 5.1

    # Settings in config/environments/* take precedence over those specified here.
    # Application configuration should go into files in config/initializers
    # -- all .rb files in that directory are automatically loaded.
    config.time_zone = "Central Time (US & Canada)"
    config.active_record.default_timezone = :local # Or :utc
    config.eager_load_paths += Dir["#{config.root}/lib/custom_rb/**/"]

    config.assets.enabled = true
    config.assets.paths << Rails.root.join("app", "assets", "images", "iCheck")
    config.assets.paths << Rails.root.join("app", "assets", "fonts")

    # For sidekiq
    #config.active_job.queue_adapter = :delayed_job
    config.active_job.queue_adapter = :sidekiq
  end
end

这是我的config/initializers/assets.rb文件:

# Be sure to restart your server when you modify this file.

# Version of your assets, change this if you want to expire all your assets.
Rails.application.config.assets.version = '1.0'

# Add additional assets to the asset load path.
# Rails.application.config.assets.paths << Emoji.images_path
# Add Yarn node_modules folder to the asset load path.
Rails.application.config.assets.paths << Rails.root.join('node_modules')

# Precompile additional assets.
# application.js, application.css, and all non-JS/CSS in the app/assets
# folder are already added.
# Rails.application.config.assets.precompile += %w( admin.js admin.css )
Rails.application.config.assets.precompile << /\.(?:svg|eot|woff|ttf)\z/

我还重新启动了Apache,但它仍然不存在。

我在做什么错了?

0 个答案:

没有答案