From: Minero Aoki Date: 2003-06-22T10:39:38+09:00 Subject: Re: Trying to use Net::HTTP sample program from "The Ruby Way" Hi, In mail "Re: Trying to use Net::HTTP sample program from "The Ruby Way"" Ludwigi Beethoven wrote: > > > h = Net::HTTP.new("www.ruby-lang.org", 80) > > > resp, data = h.get("/en/index.html", nil) > > > > What version of ruby are you using? > > If it is ruby 1.8, try latest version. > The version, ruby -v, that I am using is: > > 1.7.2 under MS/Windows. Ah, I'm sorry. "ruby 1.8" means "devlopping branch of ruby". 1.7.x and 1.8.0 is both developping branch, you need to update ruby. Reason: * net/http is incompatible with the one included in ruby 1.6. Net::HTTP#get returns [HTTPResponse, String] in 1.6, but same method returns the single HTTPResponse object in 1.7.x and 1.8. * But for backward compatibility, HTTPResponse#to_ary is added. So you can use old code without modifying code. This modification is done in ruby 1.8, you need update ruby to 1.8. Regards, Minero Aoki