在routes.rb中添加Rack :: Offline配置时出现带有Capistrano错误的Rails 3.2部署

时间:2013-01-25 17:35:16

标签: ruby-on-rails-3 capistrano

在添加之前,我的部署很好...... 我将以下代码添加到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

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

  * 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

无论如何都要避免这个错误..我会尝试部署wo这个块然后重新插入并再次重新部署,但我想它也会在远程服务器预编译期间失败

1 个答案:

答案 0 :(得分:1)

它与此块无关.....而是与css预编译错误有关... 我试图在本地预编译,但我收到了错误

" ...- border-radius:":预期的伪类或伪元素之后的无效CSS是" 10px的;"

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

抱歉糟糕的曲目