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

标签 ruby-on-rails capistrano asset-pipeline sprockets

涡轮 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/

相关文章:

ruby-on-rails - 部署前如何在 Assets 管道中找到丢失的图像

ruby-on-rails - 类型为 GIN 或 GiST 的 Rails 4 pgsql add_index

javascript - 可以使用 Stripe JS 创建没有付款信息的 token

ruby-on-rails - try 方法和 && 运算符有相同的用途吗?

ruby-on-rails - Passenger + Capistrano + Apache = Rails 应用程序未运行

ruby-on-rails - Capistrano 开发部署失败

css ->=Rails 3.1 如何在 Assets 管道中包含 IE 特定的 YAML-CSS 文件

ruby-on-rails - 如何确保 Rails Controller 将发布到它的数据处理为 JSON?

ruby-on-rails - Capistrano 部署后 Carrierwave 上传的图像不会持久

javascript - 来自 javascript css 的 rails asset-url