Open-uri problem

I have changed the production server (debian, ruby 1.8.5 ) of one of
my apps, and a script I was running doesn’t work anymore.

Basically the script tries to open a web page. Something like this:

require ‘rubygems’
require ‘open-uri’

open(“http://www.ruby-lang.org/”) {|f|
f.each_line {|line| p line}
}

The error it returns, for every page I’ve tried, is:

/usr/lib/ruby/1.8/net/http.rb:560:in `initialize’: Connection refused

  • connect(2) (Errno::ECONNREFUSED)
    from /usr/lib/ruby/1.8/net/http.rb:560:in open' from /usr/lib/ruby/1.8/net/http.rb:560:inconnect’
    from /usr/lib/ruby/1.8/timeout.rb:48:in timeout' from /usr/lib/ruby/1.8/timeout.rb:76:intimeout’
    from /usr/lib/ruby/1.8/net/http.rb:560:in connect' from /usr/lib/ruby/1.8/net/http.rb:553:indo_start’
    from /usr/lib/ruby/1.8/net/http.rb:542:in start' from /usr/lib/ruby/1.8/open-uri.rb:242:inopen_http’
    from /usr/lib/ruby/1.8/open-uri.rb:616:in buffer_open' from /usr/lib/ruby/1.8/open-uri.rb:164:inopen_loop’
    from /usr/lib/ruby/1.8/open-uri.rb:162:in catch' from /usr/lib/ruby/1.8/open-uri.rb:162:inopen_loop’
    from /usr/lib/ruby/1.8/open-uri.rb:132:in open_uri' from /usr/lib/ruby/1.8/open-uri.rb:518:inopen’
    from /usr/lib/ruby/1.8/open-uri.rb:30:in `open’

What can it be? I haven’t found a lot of infos on this error, so every
hint (firewall problem? bug in the ruby version?.. ) is appreciated.

Maybe your web proxy locally refuses to connect ruby-lang.org, or maybe
your app want to connect ruby-lang.org using local proxy like
127.0.0.1:80 or 8080, this web has the same trouble with you :

http://ghetto-net.blogspot.com/2006/09/i-want-my-lyrics.html

Maybe you can crosscheck to web above. Good Luck.

Reinhart
http://teapoci.blogspot.com


FREE eBook for Ruby:
http://teapoci.blogspot.com/search/label/eBook

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs