From: "ara.t.howard" Date: 2008-07-26T05:42:07+09:00 Subject: Re: Simultaneously URL call, is it possible? On Jul 25, 2008, at 2:19 PM, Toki Toki wrote: > It seems that I've some problem with the gem threadify or > rubygems...I i > run the code that you've poste I get the error: > >> ruby threadify.rb > ./threadify.rb:6: undefined method `threadify' for # > (NoMethodError) > from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `gem_original_require' > from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `require' > from threadify.rb:3 >> Exit code: 1 > > This is the require in irb: > > irb(main):001:0> require 'rubygems' > => false > irb(main):002:0> require 'threadify' > => true cfp:~ > cat a.rb require 'rubygems' require 'open-uri' require 'threadify' uris = %w( http://google.com http://yahoo.com ) results = %w( http://google.com http://yahoo.com ).threadify do |uri| open(uri){|fd| fd.read} end puts results.map{|result| result[0, 42]} cfp:~ > ruby a.rb