tags:

views:

26

answers:

0
>>  Net::HTTP.start("127.0.0.1", 3000) { |http| http.get('/') }
=> #<Net::HTTPFound 302 Found  readbody=true>

>>  Net::HTTP.start("localhost", 3000) { |http| http.get('/') }
Errno::ECONNREFUSED: Connection refused - connect(2)

Localhost is registered in /etc/hosts as follows:

127.0.0.1       localhost

Telnet to both address works. So I think the error might be in the Net::HTTP implementation.

$ ruby -v
ruby 1.8.7 (2010-01-10 patchlevel 249) [x86_64-linux]

Does anybody knows what I can do?