Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/58.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 涡轮链轮导轨3不支持正确展开回滚_Ruby On Rails_Capistrano_Asset Pipeline_Sprockets - Fatal编程技术网

Ruby on rails 涡轮链轮导轨3不支持正确展开回滚

Ruby on rails 涡轮链轮导轨3不支持正确展开回滚,ruby-on-rails,capistrano,asset-pipeline,sprockets,Ruby On Rails,Capistrano,Asset Pipeline,Sprockets,在以下情况下,涡轮链轮似乎出现故障: 对分支中现有的css文件进行一些更改 运行资源:预编译rake任务 css文件将由该gem编译 现在签出/回滚到修改css文件后的旧提交 运行预编译rake任务不会编译css文件,它仍然包含在稍后提交中对css文件所做的更改 预期结果:css文件应重新编译,因为它已恢复到以前的状态 编辑: application.rb中的相关代码 #for PDF config.middleware.use PDFKit::Middleware, :print_media_

在以下情况下,涡轮链轮似乎出现故障:

  • 对分支中现有的css文件进行一些更改
  • 运行资源:预编译rake任务
  • css文件将由该gem编译
  • 现在签出/回滚到修改css文件后的旧提交
  • 运行预编译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
    
    # Enable the asset pipeline
    config.assets.enabled = false
    
    从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
    

    更改以下文件:

    环境/production.rb:

    # Don't fallback to assets pipeline if a precompiled asset is missed
    config.assets.compile = false
    
    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
    
    # Enable the asset pipeline
    config.assets.enabled = false
    

    你是否
    rake-assets:clean
    ?@ptd,rake-assets:clean删除已编译的资产,那么turbo-sprockets-rails3 gem有什么用处。你能发布你的config/application.rb和config/emvironments/production.rb吗?@eabraham问题更新了上述细节。你执行什么命令进行“签出/回滚”?使用此配置时,不会使用“rake资产:预编译”对资产进行预编译