Exception "can't convert URI::HTTPS into String"

Hello. I’m trying to to an http post to an https: url (paypal’s ipn
postback), and I’m getting this error: “can’t convert URI::HTTPS into
String”. Does anyone know what this means and how I can fix it? The
relevant code looks like this:

      PAYPAL_IPN_POSTBACK_URL = "https://www.sandbox.paypal.com"

      PAYPAL_IPN_POSTBACK_REQUEST_URI = "/cgi-bin/webscr"


      ### from traces I know it gets here okay

      ### next line blows up with "can't convert URI::HTTPS into

String" ###


request.raw_post) do |response|
### from traces I know it never gets here
response.read_body do |body|
STDOUT.puts body

This blows up on the second line, the call to request_post. Does
anyone know what the problem is? Incidentally, I know that there’s a
paypal gem I can use for the paypal postback, but I’ve come this far
and I’d like to get this working. Also, this is running in Ruby on

Thanks for any help.

  • Jake
      ### next line blows up with "can't convert URI::HTTPS into
  • Jake

All you have to do is put .to_s at the end of your URI::HTTP to turn it
into a url string.

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