How to resolve Curl::Err::ConnectionFailedError calling http_get method of ruby curb gem?

858 views Asked by At

when I call http_get method of curb gem like

Curl::Easy.http_get(url)

I am getting an exception

error='Curl::Err::ConnectionFailedError: Couldn't connect to server' duration=7805.63 view=0.00 db=1.33 remote_ip=127.0.0.1

  Curl::Err::ConnectionFailedError - Couldn't connect to server:
  curb (0.9.3) lib/curl/easy.rb:73:in `perform'
  curb (0.9.3) lib/curl/easy.rb:296:in `http'
  curb (0.9.3) lib/curl/easy.rb:296:in `http_get'
  curb (0.9.3) lib/curl/easy.rb:347:in `http_get' 
  () home/punitcse/projects/project-name/core/modulename/here.rb:30:in `block in route'

The issue is only producing in my system on other system it is working fine.I have tried various things to resolve this issue like I have rebuild the curl with ares as this link suggested How do I install curl with ares enabled . I tried to debug the gem but could not completely understand why the error is coming.

Here is the output of curl version

$ curl --version
curl 7.35.0 (x86_64-unknown-linux-gnu) libcurl/7.35.0 OpenSSL/1.0.1f zlib/1.2.8 libidn/1.28 librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp smtp smtps telnet tftp 
Features: AsynchDNS GSS-Negotiate IDN IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP 

Please let me know if anything else is needed.

0

There are 0 answers