Issue #5557 has been reported by Matthew Johnson.

----------------------------------------
Bug #5557: ftp error uploading binary files
http://redmine.ruby-lang.org/issues/5557

Author: Matthew Johnson
Status: Open
Priority: Normal
Assignee: 
Category: 
Target version: 
ruby -v: ruby 1.8.7 (2010-01-10 patchlevel 249) [universal-darwin11.0]


I have a build script which uploads resulting zip files to a Dreamhost account using net/ftp.  It used to work fine and no longer works.  I have verified on a few machines that it appears to work fine on my Macs which have patch level 174 (Snow Leopard), but not on my Macs which have patch level 249 (both Snow Leopard and Lion).  All Macs are on 1.8.7 so it appears that the patch level is where the break happened.

Here is a sample representing the kind of code that I have in my script (I have obviously taken out the actual domain, username, password, etc).

require 'net/ftp'
Net::FTP.open "ftp.mysite.com" do |ftp|
  ftp.login "...", "..."
  ftp.chdir "mybuilds"
  ftp.putbinaryfile "myfile.zip"
end

Here is the stack trace I get:

Errno::EINVAL: Invalid argument

method write	in ftp.rb at line 456
method storbinary	in ftp.rb at line 456
method loop	in ftp.rb at line 453
method storbinary	in ftp.rb at line 453
method synchronize	in monitor.rb at line 242
method storbinary	in ftp.rb at line 450
method putbinaryfile	in ftp.rb at line 562
method upload	in build.rb at line 67
method build	in build.rb at line 86
method run_builds	in build.rb at line 127
method each	in build.rb at line 102
method run_builds	in build.rb at line 102
at top level	in build.rb at line 168
method open	in ftp.rb at line 115
at top level	in build.rb at line 165



-- 
http://redmine.ruby-lang.org