[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

I can't establish network connections with Ruby.

meaneyedcat

5/15/2005 3:22:00 PM

For some reason, I am unable to establish network connections anymore
with Ruby code. For example, I execute the following code:

01 require 'net/http'
02 Net::HTTP.start('www.pragmaticprogrammer.com') do |http|
03 response = http.get('/index.html')
04 puts response.code
05 end

And the application will simply hang. I don't believe it is a firewall
issue because and I believe it is specific to (my install of) Ruby
because:

1. I have shut down all my firewalls
2. I can access the same web sites with my browser
3. I setup a Tomcat servlet container on localhost, and the above code
still hangs (even using 127.0.0.1, 192.168.1.XXX, localhost)
4. When I try to run Ruby on Rails, the server won't accept a
connections from my browser (Rails shows no errors and logs no
messages, it too effectively hangs)
5. When I try to do a /path/to/gem update, it hangs
6. All other ruby apps seem to run fine if they do not access the net.

I have uninstalled Ruby and reinstalled it, but that didn't help. I am
running on WindowsXP SP2. Does Ruby depend on any components of Windows
that may have become corrupt?

Any help is GREATLY appreciated!
Thanks!
BCOT

2 Answers

Mike

5/15/2005 4:16:00 PM

0

> For some reason, I am unable to establish network connections
> anymore with Ruby code. For example, I execute the following code:
>
> 01 require 'net/http'
> 02 Net::HTTP.start('www.pragmaticprogrammer.com') do |http|
> 03 response = http.get('/index.html')
> 04 puts response.code
> 05 end
>
> And the application will simply hang. I don't believe it is a
> firewall issue because and I believe it is specific to (my
> install of) Ruby
> because:
>
<snip>
>
> I have uninstalled Ruby and reinstalled it, but that didn't
> help. I am running on WindowsXP SP2. Does Ruby depend on any
> components of Windows that may have become corrupt?
>

I tried your code and it worked just fine for me - so there's no problems
there.

If you reinstalled Ruby, then that tends to rule out the possibility of the
Net library being FUBAR'ed.

Can you

telnet www.pragmaticprogrammer.com 80

And then type GET when you reach a connected blinking cursor? Do you connect
and see a returned bunch of HTML? If that fails, then it's your machine. If
not, then we know that you can at least get outgoing connections from your
machine. Also, you can try typing:

netsh firewall show state

To see what the exact state of the XP firewall is for certain. It should say
"Operational mode = Disabled".

Do you have any additional firewalls -installed- on the computer (even if
they're disabled)? I've seen many cases where ZoneAlarm does some crazy
stuff to your machine (even when it's disabled and removed).

Hope some of that helps.

-M



Aaron Rustad

5/15/2005 6:40:00 PM

0

Hi Mike, thanks for the help. I had ZoneAlarm shutdown, and it still
didn't work. I uninstalled it and everything seems to work for me now.

thanks!
BCOT.