How can I install Ruby gems on a Mac behind a corp

2019-07-07 02:37发布

问题:

I am trying to install ruby gems on my MacOS OS X 10.5.1 behind a corporate firewall proxy. But I am getting an error about connection refused.

How can I install Ruby gems on a Mac behind a corporate proxy?

回答1:

Specify the proxy to use:

export HTTP_PROXY='http://username:password@proxyserver.net:port/'

If it's a Windows proxy (common in EnterpriseLand), it will use a custom NTLM authentication, which normal Unix apps don't do. To fix it, get NTLMAPS - a small Python app that acts as a local regular proxy and handballs your credential via NTLM authentication to the Windows proxy.



回答2:

Download the gem to your harddrive and install it manually by doing

gem install gem_file.gem