gpt4 book ai didi

ruby-on-rails - turbo-sprockets-rails3 不支持正确部署回滚

转载 作者:行者123 更新时间:2023-12-04 19:37:49 29 4
gpt4 key购买 nike

涡轮 sprockets 似乎在以下情况下失效:

  1. 对分支中现有的 css 文件进行一些更改。
  2. 运行 Assets :预编译 rake 任务。
  3. css 文件将由这个 gem 编译。
  4. 现在 check out /回滚到修改 css 文件后的旧提交。
  5. 运行预编译 rake 任务不会编译 css 文件,它仍然包含在稍后提交中对 css 文件所做的更改。

预期结果:css文件应该重新编译,因为它已经恢复到之前的状态。

编辑:application.rb中的相关代码

#for PDF
config.middleware.use PDFKit::Middleware, :print_media_type => true

# Enable the asset pipeline
config.assets.enabled = true

# Version of your assets, change this if you want to expire all your assets
config.assets.version = '1.0'
config.middleware.use I18n::JS::Middleware

config.sass.preferred_syntax = :sass
config.generators.stylesheet_engine = :sass
config.generators.template_engine = :slim

config.cache_store = :file_store, "tmp/cache" # specifying the cache store to file_store with the default tmp/cache dir

## Append path to the end of routes file to catch routing errors specifically.
config.after_initialize do |app|
app.routes.append{ match '*a', :to => 'application#error_404' } unless config.consider_all_requests_local
end

来自 environments/production.rb :

config.cache_classes = true

# Full error reports are disabled and caching is turned on
config.consider_all_requests_local = false
config.action_controller.perform_caching = true

# Disable Rails's static asset server (Apache or nginx will already do this)
config.serve_static_assets = false

# Compress JavaScripts and CSS
config.assets.compress = true

# Don't fallback to assets pipeline if a precompiled asset is missed
config.assets.compile = true

# Generate digests for assets URLs
config.assets.digest = true

最佳答案

更改以下文件:

环境/生产.rb:

# Don't fallback to assets pipeline if a precompiled asset is missed
config.assets.compile = false

应用.rb

# Enable the asset pipeline
config.assets.enabled = false

关于ruby-on-rails - turbo-sprockets-rails3 不支持正确部署回滚,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27725455/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com