在添加之前,我的部署很好......我将以下代码添加到 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
有没有办法避免这个错误..我会尝试部署这个块然后再次插入它并再次重新部署,但我想它也会在远程服务器预编译期间失败