ypwmpg
Last Updated: February 25, 2016
·
2.062K
· billagee
5784e9655a5f2ec5f18205f5cdd3de97

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

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

tar: Ignoring unknown extended header keyword `SCHILY.dev'

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.

Say Thanks
Respond

2 Responses
Add your response

9214
97e4482e00edf8b4a8bc4feb75ef0e7e

This problem has me curious. It used to be that back in the day, you had to set this environment variable to build proper tarbals for CPAN/Perl, deploy to cap, etc:

COPY_EXTENDED_ATTRIBUTES_DISABLE=true

Now, for a few people, this SCHILY.dev error popped up in capistrano, even after plenty of successful deploys in the past.

Why now? Did an OSX update tar lately or something to cause this?

over 1 year ago ·
13688
E84ccf5cd7939b97be69d8bbd789f46f

It looks like GNU tar is not included with OS X Mavericks. To work around this, we've been checking whether /usr/bin/gnutar exists rather than checking the operating system name:

set :gnu_tar_path, "/usr/bin/gnutar"
set :copy_local_tar, gnu_tar_path if File.exist?(gnu_tar_path)
over 1 year ago ·