我无法禁用rails中的sprockets资产缓存

问题描述 投票:0回答:1

我已经尝试了很多来禁用链中的sprockets资产缓存,但没有白费。我试图配置development.rb但它根本不工作。我正在使用此代码来禁用缓存生成

config.assets.cache_store = :null_store  # Disables the Asset cache
config.sass.cache = false  # Disable the SASS compiler cache

ruby version = 2.3.3 rails version = 5.0.1提前感谢。

ruby-on-rails ruby caching sprockets
1个回答
1
投票

根据Rails docs,将以下代码块添加到您的environment / development.rb中

config.assets.configure do |env|
  env.cache = ActiveSupport::Cache.lookup_store(:null_store)
end
© www.soinside.com 2019 - 2024. All rights reserved.