So, I''m using TechnoWeenie''s recipe (
http://rails.techno-weenie.net/tip/2006/4/3/integrating_file_column_and_capistrano
) for using Capistrano to deploy to a remote machine when the SVN
repository isn''t accessible over the Internet.
I keep running into a problem, though, with
put(File.read("code_update.tar.gz"), "code_update.tar.gz")
When Cap tries to untar the file, I get the following error message:
gzip: stdin: invalid compressed data--format violated
What I think is going on here is that on Windows, there is a distinction
between binary files and all others. So, File.read isn''t taking this
into account, and the binary data is read incorrectly into the first
string arugment for put.
Does anyone know a way to reliably transfer a binary file from my
Windows machine using Capistrano? I am not wed to using put. I could try
using rsync or scp via a call to system, but I''d like to keep it as
Ruby
as possible (in fact, I''d love to replace the calls to system used to
tar up the archive, if possible).
Thanks!
--
Posted via http://www.ruby-forum.com/.
> -----Original Message----- > From: rails-bounces@lists.rubyonrails.org > [mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of Will Green > Sent: Monday, July 10, 2006 10:31 AM > To: rails@lists.rubyonrails.org > Subject: [Rails] Capistrano on Windows - Send Binary File > > > So, I''m using TechnoWeenie''s recipe ( > http://rails.techno-weenie.net/tip/2006/4/3/integrating_file_c > olumn_and_capistrano > ) for using Capistrano to deploy to a remote machine when the SVN > repository isn''t accessible over the Internet. > > I keep running into a problem, though, with > > put(File.read("code_update.tar.gz"), "code_update.tar.gz")<snip> You''ll have to use the instance method instead, which lets you specify binary mode: data = nil File.open(''code_update.tar.gz'', ''rb''){ |fh| data = fh.read } put(data, ''code_update.tar.gz'') HTH, Dan This communication is the property of Qwest and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments.