我后面的防火墙以ntlm模式运行Microsoft ISA服务器。哈希任何人成功地获得他们的Ruby宝石安装/更新通过Ruby SSPI宝石或其他方法?

... 还是我太懒了?

注意:rubysspi-1.2.4不起作用。

这也适用于“igem”,IronRuby项目的一部分


当前回答

如果你在通过代理进行身份验证时遇到问题,请确保按照下面的格式设置环境变量:

set HTTP_PROXY=some.proxy.com
set HTTP_PROXY_USER=user
set HTTP_PROXY_PASS=password

user:password@语法似乎不起作用,在Stack Overflow和各种论坛帖子中也有一些命名糟糕的环境变量。

同时也要注意,你的gems可能需要一段时间才能开始下载。一开始我以为这行不通,但经过耐心之后,他们开始按预期下载。

其他回答

rubysspi-1.3.1适用于我的Windows 7,使用这一页的说明:

http://www.stuartellis.eu/articles/installing-ruby/

这对我来说在Windows盒子里很管用:

set HTTP_PROXY=http://server:port
set HTTP_PROXY_USER=username
set HTTP_PROXY_PASS=userparssword
set HTTPS_PROXY=http://server:port
set HTTPS_PROXY_USER=username
set HTTPS_PROXY_PASS=userpassword

我有一个包含这些行的批处理文件,当我需要它时,我用它来设置环境值。

在我的例子中,诀窍是HTTPS_PROXY集。没有它们,我总是得到一个407代理身份验证错误。

对于任何使用SSH隧道的人;你可以创建一个使用SOCKS代理的gem命令版本:

Install socksify with gem install socksify (you'll need to be able to do this step without proxy, at least) Copy your existing gem exe cp $(command which gem) /usr/local/bin/proxy_gem Open it in your favourite editor and add this at the top (after the shebang) require 'socksify' if ENV['SOCKS_PROXY'] require 'socksify' host, port = ENV['SOCKS_PROXY'].split(':') TCPSocket.socks_server = host || 'localhost' TCPSocket.socks_port = port.to_i || 1080 end Set up your tunnel ssh -D 8123 -f -C -q -N user@proxy Run your gem command with proxy_gem SOCKS_PROXY=localhost:8123 proxy_gem push mygem

快速回答:为安装/更新添加带有参数的代理配置

gem install --http-proxy http://host:port/ package_name

gem update --http-proxy http://host:port/ package_name

如果您使用的是*nix系统,请使用以下命令:

export http_proxy=http://${proxy.host}:${port}
export https_proxy=http://${proxy.host}:${port}

然后试试:

gem install ${gem_name}