On Mon, Mar 19, 2001 at 11:11:22PM +0900, Tammo Freese wrote:
> 
> Socket.getservbyname seems not to find http. 
> 
> $ ruby -ve 'require "socket"; puts Socket.getservbyname("http")'
> ruby 1.6.3 (2001-03-19) [i686-cygwin]
> -e:1:in `getservbyname': no such servce http/tcp (SocketError)
>         from -e:1
> 
> It works at least with finger, telnet and ftp.

Ruby just calls your system's getservbyname() function, which in this
case is cygwin's getservbyname().  So the problem is probably with
cygwin and not ruby.

But!  This URL http://www.cygwin.com/ml/cygwin/2000-11/msg01177.html
says that cygwin's getservbyname() is just a mapping to the Win32
getservbyname().  So the bug is probably with windows itself.  It also
says it looks for a file called "protocols" in your win95/winnt/win2k
directory.  My c:\winnt\system32\drivers\etc\protocols file does not
include http, so your example doesn't work on my system either.

You can just edit your "protocols" file to include http and things will
start to work.

-- 
matt