The following code gives .../lib/ruby/1.8/open-uri.rb:215:in `open_http': uninitialized constant Net::HTTP (NameError)
:
require 'open-uri'
a = Thread.new { open('http://www.google.com/') }
b = Thread.new { open('http://www.google.com/') }
a.join
b.join
Strangely enough, adding require 'net/http' to the top makes it work just fine, though I assume require 'open-uri' is
supposed to do that automatically. open-uri seems to work fine other than that.
I am using ruby 1.8.4 (2006-04-14) [i386-mswin32] from the one-click installer.
|