title: Errno::EPIPE: Broken pipe with Net::FTP
body: <p>Similar to <a href="https://stackoverflow.com/questions/15259199/anyone-get-working-ftps-ftptls-under-ruby-1-9-3">this question</a>, I can connect and even check/change the working directory, but calling <code>list</code> throws a <code>Errno::EPIPE: Broken pipe</code> error.</p>
  
  <p>So far I've only seen this from Terminal (OS X). I've tried a couple different hosts, which I've verified I can access normally with FileZilla. I've also verified I can list files via a regular ol' command-line <code>ftp</code> session.</p>
  
  <p>Could this be a firewall issue? Or an issue with my shell?</p>
  
  <p>Here's an example IRB session...</p>
  
  <pre><code>irb&gt; ftp = Net::FTP.new 'host.domain.com' 
   =&gt; #&lt;Net::FTP:0x007fc10d053ab8 @mon_owner=nil, @mon_count=0, @mon_mutex=#&lt;Mutex:0x007fc10d053a68&gt;, @binary=true, @passive=false, @debug_mode=false, @resume=false, @sock=#&lt;TCPSocket:fd 7&gt;, @logged_in=false, @last_response="220 ESS FTP\n", @last_response_code="220"&gt; 
  irb&gt; ftp.debug_mode = true
   =&gt; true 
  irb&gt; ftp.login 'user', '*********'
  put: USER user
  get: 331 Password required for user
  put: PASS *********
  get: 230 Logged on
  put: TYPE I
  get: 200 Type set to I
   =&gt; true 
  irb&gt; ftp.pwd
  put: PWD
  get: 257 "/" is current directory.
    =&gt; "/" 
  irb&gt; ftp.chdir 'Inventory'
  put: CWD Inventory
  get: 250 CWD successful. "/Inventory" is current directory.
  irb&gt; ftp.list
  put: TYPE A
  get: 200 Type set to A
  put: PORT 10,142,96,98,199,111
  put: TYPE I
  Errno::EPIPE: Broken pipe
    from /Users/acobster/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/net/ftp.rb:257:in `write'
    from /Users/acobster/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/net/ftp.rb:257:in `putline'
    from /Users/acobster/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/net/ftp.rb:334:in `block in voidcmd'
    from /Users/acobster/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
    from /Users/acobster/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/net/ftp.rb:333:in `voidcmd'
    from /Users/acobster/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/net/ftp.rb:162:in `send_type_command'
    from /Users/acobster/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/net/ftp.rb:151:in `binary='
    from /Users/acobster/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/net/ftp.rb:180:in `ensure in with_binary'
    from /Users/acobster/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/net/ftp.rb:180:in `with_binary'
    from /Users/acobster/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/net/ftp.rb:477:in `block in retrlines'
    from /Users/acobster/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
    from /Users/acobster/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/net/ftp.rb:476:in `retrlines'
    from /Users/acobster/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/net/ftp.rb:722:in `list'
    from (irb):9
    from /Users/acobster/.rvm/rubies/ruby-1.9.3-p392/bin/irb:16:in `&lt;main&gt;'
  </code></pre>
  
  <p>Please help, thanks!</p>
  
  <h1>Update: I can do <code>ftp.list</code> from an IRB session on a remote server...</h1>
  
  <pre><code>$ ssh myserver
  server $ irb
  irb&gt; ftp = Net::FTP.new 'host.domain.com' 
  =&gt; #&lt;Net::FTP:0x2b7d3c5edc80 @last_response="220 ESS FTP\n", @debug_mode=false, @mon_entering_queue=[], @sock=#&lt;TCPSocket:0x2b7d3c5edb18&gt;, @passive=false, @mon_count=0, @binary=true, @mon_owner=nil, @last_response_code="220", @resume=false, @mon_waiting_queue=[]&gt;
  irb&gt; ftp.login 'user', 'pass'
  =&gt; "230 Logged on\n"
  irb&gt; ftp.pwd
  =&gt; "/"
  irb&gt; ftp.chdir 'Inventory'
  =&gt; nil
  irb&gt; ftp.list 
  =&gt; ["-r--r--r-- 1 ftp ftp         302301 Feb 26 20:27 inventory.zip", "-r--r--r-- 1 ftp ftp        1450282 Feb 26 20:24 InventoryWeb.txt"]
  </code></pre>
  
  <p>...but I'm not sure what conclusion to draw from this? My local version of Ruby? Could it still be a firewall/shell issue?</p>