From: Patrick Down Date: 2001-02-27T00:51:06+09:00 Subject: [ruby-talk:11595] Net::FTP This is a multi-part message in MIME format. ------=_NextPart_000_0063_01C09FD9.F46AE660 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, I am new to Ruby. I was trying out the Net::FTP object using code from Chapter 26 of Programming Ruby and I was having a rather odd problem. First, I am running Win2000 using the InstallShield instalation from = http://dev.rubycentral.com/downloads/ruby-install.html This is a small ruby program I wrote called ftptest.rb: require "net/ftp" ftp =3D Net::FTP.new("ftp.cdrom.com") ftp.login ftp.close Here is the error I get: E:\Programming\Tools\ruby>ruby < ftptest.rb /cygdrive/e/Programming/Tools/ruby/lib/ruby/1.6/net/ftp.rb:57:in `open': = Invalid argument - "connect(2)" (Errno::EINVAL) from = /cygdrive/e/Programming/Tools/ruby/lib/ruby/1.6/net/ftp.rb:57:in = `open_socket' from = /cygdrive/e/Programming/Tools/ruby/lib/ruby/1.6/net/ftp.rb:67:in = `connect' from = /cygdrive/e/Programming/Tools/ruby/lib/ruby/1.6/net/ftp.rb:67:in = `mon_synchronize' from = /cygdrive/e/Programming/Tools/ruby/lib/ruby/1.6/net/ftp.rb:67:in = `connect' from = /cygdrive/e/Programming/Tools/ruby/lib/ruby/1.6/net/ftp.rb:45:in = `initialize' from -:3:in `new' from -:3 This seems to be a problem in The TCPSocket object open method but being = completely new to ruby Can any tell me what I am doing wrong? ------=_NextPart_000_0063_01C09FD9.F46AE660 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi, I am new to Ruby.  I was = trying out the=20 Net::FTP object using
code from Chapter 26 of Programming = Ruby and I was=20 having a
rather odd problem.  First, I am = running=20 Win2000 using the
InstallShield instalation from http://de= v.rubycentral.com/downloads/ruby-install.html
 
This is a small ruby program I wrote = called=20 ftptest.rb:
require "net/ftp"
 
ftp =3D Net::FTP.new("ftp.cdrom.com")
ftp.login
ftp.close
 
Here is the error I get:
E:\Programming\Tools\ruby>ruby <=20 ftptest.rb
/cygdrive/e/Programming/Tools/ruby/lib/ruby/1.6/net/ftp.rb:= 57:in=20 `open': Invalid  argument - "connect(2)"=20 (Errno::EINVAL)
        from=20 /cygdrive/e/Programming/Tools/ruby/lib/ruby/1.6/net/ftp.rb:57:in=20 `open_socket'
        from=20 /cygdrive/e/Programming/Tools/ruby/lib/ruby/1.6/net/ftp.rb:67:in=20 `connect'
        from=20 /cygdrive/e/Programming/Tools/ruby/lib/ruby/1.6/net/ftp.rb:67:in=20 `mon_synchronize'
        from=20 /cygdrive/e/Programming/Tools/ruby/lib/ruby/1.6/net/ftp.rb:67:in=20 `connect'
        from=20 /cygdrive/e/Programming/Tools/ruby/lib/ruby/1.6/net/ftp.rb:45:in=20 `initialize'
        from -:3:in=20 `new'
        from = -:3
 
This seems to be a problem in The = TCPSocket object=20 open method but being completely new to ruby
Can any tell me what I am doing = wrong?
 
------=_NextPart_000_0063_01C09FD9.F46AE660--