使用代理在Windows 7上安装gems

我试图在代理后面的Windows 7上安装ruby。

我已经查看了各种论坛并成功设置了(我认为)http_proxy(见下文)

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

但是,我现在在尝试安装gem时遇到以下错误:

 SocketError: getaddrinfo: No such host is known. 

有任何想法吗?

HTTP_PROXY语法需要是URI:

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

scheme可以是httphttps ,在某些情况下, path可能不存在。

没有浏览器(或RubyGems)会接受您提供的URL作为有效URL。

所以在你的情况下:

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

希望有所帮助

在工作中我也有一个proyx,SET HTTP_PROXY = http://proxyhere.com:8080在那里工作,所以尝试不使用usename /密码。 这取决于我推测的代理类型。

你也可以使用gem install –http-proxy http://proxyhere.com:8080 $ gem_name

有关详细信息,请参阅此内容如何从代理(ISA-NTLM)后面更新Ruby Gems