capistrano 2:在本地主机的路径中找不到“tar”

capistrano 2 : `tar' could not be found in the path on the local host

我正在使用 Capistrano 版本 2 并尝试在服务器上部署代码。

但是当我输入 cap deploy:check 命令时,出现以下错误。

   * executing "which tar"
    servers: ["53.79.454.474"]
    [53.79.454.474] executing command
    command finished in 1088ms
The following dependencies failed. Please check them and try again:
--> `tar' could not be found in the path on the local host

我也尝试在我的远程 ubuntu 机器上安装 tar,但仍然出现同样的错误。

sudo apt-get install tar

Reading package lists... Done
Building dependency tree
Reading state information... Done
tar is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

我不知道为什么会出现此错误。请帮忙

谢谢,

出现此错误是因为保存您的存储库的计算机未安装 tar (windows)。将 :repo_url 移动到生产服务器或任何其他具有 linux 发行版的服务器时应该没有问题。

** 编辑

在移动存储库之前,您可以尝试将 production.rb

中的 :copy_compression 设置为 :zip

如果失败(可能),并且你绝对 want/need 坚持使用微软,将无法在你的回购所在的机器上安装启用 tar 的 cygwin 并添加cygwin 到您的 PATH 变量。

查看此 google discussion 了解更多信息。