From: Daniel Berger Date: 2010-04-20T07:47:23+09:00 Subject: Re: Net::Ping::HTTP inconsistencies On Apr 19, 3:33 pm, Daniel Waite wrote: > I have multiple websites that are "up". That is, they are accessible via > the browser and return to the user content. > > But... > > >> require 'net/ping' > => true > >> Net::Ping::HTTP.new('somewebsite.com').ping? > > => false > > And, sometimes (I stress, _sometimes_): > > >> require 'net/ping' > => true > >> Net::Ping::HTTP.new('http://somewebsite.com').ping? > > => true > > But then... > > >> require 'net/ping' > => true > >> Net::Ping::HTTP.new('http://somewebsite.com').ping? > > => false > > Why the inconsistency? More importantly, how can I achieve consistent > results? It's maddening when a website is obviously functional and yet I > am told it's not. Try this and see if you can determine why it's failing sometimes: require 'net/ping' http = Net::Ping::HTTP.new('http://somewebsite.com') unless http.ping? puts "Ping failed: " + ping.exception end Regards, Dan