Still cannot connect to http

P

Pradeepta Swain

I m still getting the error . I am new to ruby . I am using ruby 1.8.4
on windows XP platform . please tell me in detail how to make http
connection .I am getting error like :

c:/apps/ruby/lib/ruby/1.8/net/http.rb:560:in `initialize': Bad file
descriptor - connect(2) (Errno::EBADF)
from c:/apps/ruby/lib/ruby/1.8/net/http.rb:560:in `connect'
from c:/apps/ruby/lib/ruby/1.8/timeout.rb:48:in `timeout'
from c:/apps/ruby/lib/ruby/1.8/timeout.rb:76:in `timeout'
from c:/apps/ruby/lib/ruby/1.8/net/http.rb:560:in `connect'
from c:/apps/ruby/lib/ruby/1.8/net/http.rb:553:in `do_start'
from c:/apps/ruby/lib/ruby/1.8/net/http.rb:542:in `start'
from t2.rb:4

and my code is :

require 'net/http'
require 'rubygems'
Net::HTTP.start('www.rubyinside.com') do |http|
req = Net::HTTP::Get.new('/test.txt')
puts http.request(req).body
end
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top