Rails:我如何强制所有资产上的新资产消化



运行带有链轮的Rails 4.2应用程序并使用资产摘要。运行rake assets:precompile时,它会用摘要创建我的所有资产。但是,我需要碰到所有资产摘要,以帮助我调试生产中的一些缓存内容。我尝试更改资产版本:

# config/initializers/assets.rb
Rails.application.config.assets.version = '6.4'

但是运行rake assets:precompile again after this is done, does not create new files with new digests。不应该吗?还是我错过了什么?

我找到了强制资产到期并重新编译的唯一方法是在我的config/environments/production.rb

中添加以下内容
config.assets.version = '1.1' #This currently doesnt work as intended so use
config.assets.prefix = '/production'

然后bundle exec rake assets:precompile RAILS_ENV=production

rails 4和链轮3不完全按照这里的线程相处Div>

最新更新