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

我已经从具有链接https的对象存储下载食谱,

需要'open-uri'打开(“/ home / admini / Desktop / apache2.tgz”,“wb”)do | write_file | 打开(“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)结束

它为某些提供商获得下载,但对于某些提供商而言,它无法获得下载,如下所示:

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从/opt/chef/embedded/lib/ruby/1.9.1/timeout.rb从/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超时'

我试过使用resolv-replace gem,但还没有解决,任何想法的家伙? 在Ruby中是否有支持https的内置库方法? 或者我们只能使用宝石?

关心,诱导


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

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

上一篇: Initialize': getaddrinfo: Name or service not known (SocketError

下一篇: Timeout:Error