From: Toki Toki Date: 2008-07-26T05:19:04+09:00 Subject: Re: Simultaneously URL call, is it possible? Ara Howard wrote: > On Jul 25, 2008, at 1:02 PM, Bret Pettichord wrote: > >> I think this needs a call to Thread#join after all the the threads >> have been >> created. Otherwise the script will exit before the threads have >> executed. > > > > > why make it hard? > > > # gem install threadify > > require 'rubygems' > require 'open-uri' > require 'threadify' > > results = > %w( http://google.com http://yahoo.com http:// > foo.bar.com ).threadify do |uri| > open(uri){|fd| fd.read} > end > > > a @ http://codeforpeople.com/ Thanks for the help. 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 I've try to run the threadify sample (http://www.ruby-forum.com/topic/159362) still no way... How can I solve this problem? Thanks. -- Posted via http://www.ruby-forum.com/.