Capistrano workaround to avoid untarring errors when deploying from OSX to Linux

发布时间: 2013-09-23 01:26:00

refer to:

If you see errors like this when capistrano is deploying from OSX to Linux:

tar: Ignoring unknown extended header keyword `'

In your capistrano task, use the line below to change the default tar program to /usr/bin/gnutar:

set :copy_local_tar, "/usr/bin/gnutar" if `uname` =~ /Darwin/
This makes Capistrano use gnutar (rather than the default OSX /usr/bin/tar) when creating the tar archive to deploy. With that change, your Linux target should be able to untar the archive without issues.

另外,使用capistrano时,务必使用 net-ssh 2.7.0, 否则其他版本会报错: invalid password...(实际上这时候我们还没开始输入密码呢)