Initialize': getaddrinfo: Name or service not known (SocketError

I ve downloading cookbooks from object storage which has link https,

require 'open-uri' open("/home/admini/Desktop/apache2.tgz","wb") do |write_file| open("https://region-a.geo-1.objects.hpcloudsvc.com:443/v1/68342917034742/cookbooks/marketplace/production/apache2.tar","rb") do |read_file| write_file.write(read_file.read) end end

it gets downloads for some providers but for some providers it doesnot get downloads ,showing like this:

from /opt/chef/embedded/lib/ruby/1.9.1/net/http.rb:762:in open' from /opt/chef/embedded/lib/ruby/1.9.1/net/http.rb:762:in block in connect' from /opt/chef/embedded/lib/ruby/1.9.1/timeout.rb:54:in timeout' from /opt/chef/embedded/lib/ruby/1.9.1/timeout.rb:99:in timeout'

I ve tried using resolv-replace gem also ,but didinot solve yet,any idea guys? Is there any built in library method for supporting https in ruby? or we have to use gem only?

Regards, indu


试试这个库https://github.com/typhoeus/typhoeus#streaming-the-response-body它非常棒,支持重定向(https://github.com/typhoeus/typhoeus#following-redirections),可以执行并行下载等等

链接地址: http://www.djcxy.com/p/38778.html

上一篇: 重复使用黄瓜步骤

下一篇: 初始化':getaddrinfo:名称或服务未知(SocketError