Capistrano未能找到资产清单

时间:2013-11-24 20:42:02

标签: ruby-on-rails ruby capistrano

我正在尝试使用Capistrano 2.15.5将Rails 3.2应用程序部署到Ubuntu 13.04。成功cap deploy:setup后,Capistrano在cap deploy:cold期间失败: failed: "sh -c 'ls /srv/www/application/shared/assets/manifest*'"

我正在使用 public / assets 中的 manifest.yml 部署预编译资产。
失败任务的完整输出:

triggering after callbacks for `deploy:update_code'
* 2013-11-24 23:06:43 executing `deploy:assets:precompile'
  triggering before callbacks for `deploy:assets:precompile'
* 2013-11-24 23:06:43 executing `deploy:assets:update_asset_mtimes'
* executing "[ -e /srv/www/application/shared/assets/manifest* ] && cat /srv/www/application/shared/assets/manifest* || echo"
  servers: ["1.1.1.1"]
  [1.1.1.1] executing command
  command finished in 443ms
* executing "cd -- /srv/www/application/releases/20131124190639 && RAILS_ENV=production RAILS_GROUPS=assets #<Capistrano::Configuration::Namespaces::Namespace:0x007f66b2e9a898> assets:precompile"
  servers: ["1.1.1.1"]
  [1.1.1.1] executing command
  command finished in 439ms
* executing "ls -1 /srv/www/application/shared/assets/manifest* | wc -l"
  servers: ["1.1.1.1"]
  [1.1.1.1] executing command
  command finished in 569ms
* executing "ls /srv/www/application/shared/assets/manifest*"
  servers: ["1.1.1.1"]
  [1.1.1.1] executing command
  command finished in 575ms
*** [deploy:update_code] rolling back
* executing "rm -rf /srv/www/application/releases/20131124190639; true"
  servers: ["1.1.1.1"]
  [1.1.1.1] executing command
  command finished in 458ms
failed: "sh -c 'ls /srv/www/application/shared/assets/manifest*'"

我该如何解决?

1 个答案:

答案 0 :(得分:5)

问题在于 executing "cd -- /srv/www/application/releases/20131124190639 && RAILS_ENV=production RAILS_GROUPS=assets #<Capistrano::Configuration::Namespaces::Namespace:0x007f66b2e9a898> assets:precompile"
这里Capistrano用名称空间对象替换rake。这是因为我在部署文件中创建了一个名称空间:rake。不知道它可能导致这样的错误。 重命名命名空间解决了这个问题。