问题
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