【问题标题】:Rails 3.2 deployment with Capistrano error when adding Rack::Offline configuration in routes.rb在 routes.rb 中添加 Rack::Offline 配置时出现 Capistrano 错误的 Rails 3.2 部署
【发布时间】:2013-01-25 17:35:15
【问题描述】:

在添加之前,我的部署很好...... 我将以下代码添加到 routes.rb 中,在开发中运行良好,但是在远程服务器 w Capistrano 上再次部署时,部署失败:

routes.rb
   Workshop::Application.routes.draw do

    if Rails.env.production?
      offline = Rack::Offline.configure :cache_interval => 120 do      
         cache ActionController::Base.helpers.asset_path("application.css")
         cache ActionController::Base.helpers.asset_path("application.js")
         # cache other assets
         images = ["favicon.ico", "empty_boxes.png", "isabelle.png", "loading.gif", "errors/not_found.jpg", "errors/access_denied.jpg", "gallery/black.png"]
         images.each do |image|
           cache ActionController::Base.helpers.asset_path(image)
          end
         ...
      end 
      ... other routes ..
   end

部署错误与任何缓存操作有关:

  * executing "cd -- /var/www/vhosts/ceramique-isabelle.fr/rails/workshop/
   releases/2013.... && bundle exec rake RAILS_ENV=production 
    RAILS_GROUPS=assets assets:precompile && cp --
  /var/www/vhosts/ceramique-isabelle.fr/rails/workshop/shared/assets/manifest.yml
 /var/www/vhosts/ceramique-isabelle.fr/rails/workshop/releases/2013../assets_manifest.yml"

  servers: ["ceramique-isabelle.fr"]
       [ceramique-isabelle.fr] executing command
       ** [out :: ceramique-isabelle.fr] rake aborted!
        [out :: ceramique-isabelle.fr] application.css isn't precompiled

如果我抑制了一些缓存行,那么它会在以下情况下失败

        [out :: ceramique-isabelle.fr] application.js isn't precompiled
         or removing the cache for application.js , it fails on the nex ...
        [out :: ceramique-isabelle.fr] favicon.ico isn't precompiled

有没有办法避免这个错误..我会尝试部署这个块然后再次插入它并再次重新部署,但我想它也会在远程服务器预编译期间失败

【问题讨论】:

    标签: ruby-on-rails-3 capistrano


    【解决方案1】:

    它与此块无关.....而是与 css 预编译错误有关... 我尝试在本地预编译,但出现错误

    “...-border-radius:”后的 CSS 无效:预期的伪类或伪元素为“10px;”

    去哪里搜索并修改....

    对不起,有问题

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-12-16
      • 2011-02-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多