With Nokogiri i am getting error “initialize': getaddrinfo: No such host is known. (SocketError)”

随声附和 提交于 2019-12-02 04:21:45

It appears you need to configure a proxy. Find out what the proxy URL/Port is for your organization (and whether there needs to be authentication). You may be able to view this information from your browser configuration. In order to use it with your Ruby code, you need to set the HTTP_PROXY environment variable.

You can set it in Ruby code:

ENV['HTTP_PROXY'] = 'http://hostname:port'

or if you need authentication:

ENV['HTTP_PROXY'] = 'http://username:password@hostname:port'

A more permanent solution is to set HTTP_PROXY in your system environment variables.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!