Issue installing gems on windows 7 with proxy

最后都变了- 提交于 2019-12-21 04:22:09

问题


I am trying to install ruby on windows 7 behind a proxy.

I have looked at various forums and have set (i think) the http_proxy successfully (see below)

SET HTTP_PROXY=http:username:password@http://proxyhere.com:8080

however, i now get the following error trying to install a gem:

SocketError: getaddrinfo: No such host is known.

Any ideas?


回答1:


The HTTP_PROXY syntax needs to be URI:

SET HTTP_PROXY=scheme://user:pass@host:port/path

scheme could be http or https and on some cases path could be absent.

No browser (or RubyGems) will accept as valid URL the one you provided.

So in your case:

SET HTTP_PROXY=http://username:password@proxyhere.com:8080/

Hope that helps




回答2:


At work i have a proyx also, SET HTTP_PROXY=http://proxyhere.com:8080 works there, so try it without usename/password. It depends on the type of proxy i presume.

You could also use:

gem install --http-proxy http://proxyhere.com:8080 $gem_name

See this for more info How do I update Ruby Gems from behind a Proxy (ISA-NTLM)



来源:https://stackoverflow.com/questions/10633557/issue-installing-gems-on-windows-7-with-proxy

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