ohho
ohho

Reputation: 51941

"bad response Proxy Authentication" when using gem on Windows

When I try to add source:

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)

p.s. my Windows XP client accesses the web via a proxy, so I tried:

C:\>gem -v
1.8.10

C:\>gem source --verbose --http-proxy http://192.168.10.24:3128 --add http://gemcutter.org

but returns the same error. How can I fix it?

Upvotes: 1

Views: 4093

Answers (1)

Moshe Katz
Moshe Katz

Reputation: 16883

You need to put the proxy username and password in there somehow.

On *nix machines, gem looks for an environment variable named HTTP_PROXY. You can set this variable on windows too.

Run SET HTTP_PROXY=http://%USER%:%PASSWORD%@192.168.10.24:3128 before you run your gem command.


Another possibility is to install another "proxy" on your computer itself. See How do I update Ruby Gems from behind a Proxy (ISA-NTLM) and http://ntlmaps.sourceforge.net/ for details on this.


You might be able to use rubysspi. See the instructions here.

Upvotes: 3

Related Questions