0
votes

Just getting started on Ruby and I can't get past the error posted below. Here's my code:

require 'HTTParty'
require 'Nokogiri'
require 'JSON'
require 'Pry'
require 'csv'

page = HTTParty.get('https://newyork.craigslist.org/search/pet?s=0')

Pry.start(binding)

error in console:

C:/Ruby23/lib/ruby/2.3.0/net/http.rb:933:in connect_nonblock': SSL_connect returned=1 errno=0 state=error: certificate verify failed (OpenSSL::SSL::SSLError) from C:/Ruby23/lib/ruby/2.3.0/net/http.rb:933:inconnect' from C:/Ruby23/lib/ruby/2.3.0/net/http.rb:863:in do_start' from C:/Ruby23/lib/ruby/2.3.0/net/http.rb:852:instart' from C:/Ruby23/lib/ruby/2.3.0/net/http.rb:1398:in request' from C:/Ruby23/lib/ruby/gems/2.3.0/gems/httparty-0.14.0/lib/httparty/request.rb:118:in perform' from C:/Ruby23/lib/ruby/gems/2.3.0/gems/httparty-0.14.0/lib/HTTParty.rb:560:in perform_request' from C:/Ruby23/lib/ruby/gems/2.3.0/gems/httparty-0.14.0/lib/HTTParty.rb:486:in get' from C:/Ruby23/lib/ruby/gems/2.3.0/gems/httparty-0.14.0/lib/HTTParty.rb:598:in get' from web_scraper.rb:7:in'

I've been online and replaced GlobalSignRootCA.pem and tried rerunning but no luck. Also tried uninstalling and reinstalling ruby and gems.

1

1 Answers

1
votes

This might be because the request tries to verify the ssl key you are sending/receiving.

You can avoid the error by adding

verify: false

to your call.

More details here.