当我尝试添加源代码时:
C:\>gem source --verbose --add http://gemcutter.org
GET http://gemcutter.org/specs.4.8.gz
407 Proxy Authentication Required
Error fetching http://gemcutter.org:
bad response Proxy Authentication Required 407 (http://gemcutter.org/specs.4.8.gz)附注:我的Windows XP客户端通过代理访问web,所以我尝试:
C:\>gem -v
1.8.10
C:\>gem source --verbose --http-proxy http://192.168.10.24:3128 --add http://gemcutter.org但返回相同的错误。我怎么才能修复它?
发布于 2011-12-22 11:55:50
您需要以某种方式将代理用户名和密码放在其中。
在*nix机器上,gem查找名为HTTP_PROXY的环境变量。你也可以在windows上设置这个变量。
在运行gem命令之前运行SET HTTP_PROXY=http://%USER%:%PASSWORD%@192.168.10.24:3128。
另一种可能是在你的计算机上安装另一个“代理”。有关这方面的详细信息,请参阅How do I update Ruby Gems from behind a Proxy (ISA-NTLM)和http://ntlmaps.sourceforge.net/。
您也许能够使用rubysspi。请参阅here说明。
https://stackoverflow.com/questions/7830981
复制相似问题