More socket problems (ftp) with Ruby and OS X 10.3

  • Thread starter David Heinemeier Hansson
  • Start date
D

David Heinemeier Hansson

It seems that the need to turn on "Socket.do_not_reverse_lookup = true"
in order to use WEBrick with OS X 10.3 isn't the only socket issue.
What follows is a basic example of attempting to do a directory listing
on a public FTP. Note that the FTP connection itself was successfully
estabilished. It's only when I attempt to ls it throws the following...

irb(main):001:0> require 'net/ftp'
irb(main):002:0> sunsite = Net::FTP.open("sunsite.auc.dk")
irb(main):003:0> sunsite.login
irb(main):004:0> sunsite.ls
SocketError: getnameinfo: nodename nor servname provided, or not known
from /usr/local/lib/ruby/1.8/net/ftp.rb:295:in `addr'
from /usr/local/lib/ruby/1.8/net/ftp.rb:295:in `makeport'
from /usr/local/lib/ruby/1.8/net/ftp.rb:329:in `transfercmd'
from /usr/local/lib/ruby/1.8/net/ftp.rb:421:in `retrlines'
from /usr/local/lib/ruby/1.8/net/ftp.rb:419:in `synchronize'
from /usr/local/lib/ruby/1.8/net/ftp.rb:434:in `retrlines'
from /usr/local/lib/ruby/1.8/net/ftp.rb:628:in `ls'
from (irb):4

...attempting the "Socket.do_not_reverse_lookup = true"-trick gives a
different exception:

irb(main):001:0> require 'net/ftp'
irb(main):002:0> require 'socket'
irb(main):003:0> Socket.do_not_reverse_lookup = true
irb(main):004:0> sunsite = Net::FTP.open("sunsite.auc.dk")
irb(main):005:0> sunsite.login
irb(main):006:0> sunsite.ls
Errno::EPROTONOSUPPORT: Protocol not supported - socket(2)
from /usr/local/lib/ruby/1.8/net/ftp.rb:295:in `initialize'
from /usr/local/lib/ruby/1.8/net/ftp.rb:295:in `open'
from /usr/local/lib/ruby/1.8/net/ftp.rb:295:in `makeport'
from /usr/local/lib/ruby/1.8/net/ftp.rb:329:in `transfercmd'
from /usr/local/lib/ruby/1.8/net/ftp.rb:421:in `retrlines'
from /usr/local/lib/ruby/1.8/net/ftp.rb:419:in `synchronize'
from /usr/local/lib/ruby/1.8/net/ftp.rb:434:in `retrlines'
from /usr/local/lib/ruby/1.8/net/ftp.rb:628:in `ls'

Any known work-arounds for this? Is the socket issues being worked on
in general?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

FTP list fails on Mac OS 10.3 0
tcp socket error 0
FTP problem under Linux? 0
Net::FTP hangs 7
Error using net::ftp 1
open-uri and ftp path 2
Mac OS X Panther FTP problem 0
"No address associated with nodename" 3

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,071
Latest member
MetabolicSolutionsKeto

Latest Threads

Top