From: "Peña, Botp" Date: 2008-09-11T18:19:45+09:00 Subject: Re: How to check if a webpage exists From: Davide Benini [mailto:nutsmuggler@hotmail.com] # I work on Mac Os X Leopard. Ruby works allright, I have also # a number of # rails websites running locally, no problems so far. # Could you help me with the proper "script" sintax; I am sure the # rationale beyond the mechanism is correct, but I ultimately need to # integrate this script in a rails application, so I need to have it # woking in a common .rb file. As I said, tried this try # require 'open-uri' # begin # open "www.does.not.exist.sdadasdas.com", :proxy=>true replace the above line with puts open("www.does.not.exist.sdadasdas.com",:proxy=>true).read post the output again # p "i'm ok" #<-- ok codes here # rescue => e # p "sorry can't do" # p "error is: #{e}" # end