Last Updated: February 25, 2016
·
429
· mativillagra

'sudo gem install ...' behind a proxy

  1. sudo visudo -f /etc/sudoers

  2. It turns out that you need to do some tweaking if you want sudo to carry your proxy environment across from the current user. To do this, run sudo visudo and add the env_keep line below:

Defaults envkeep += "httpproxy httpsproxy ftpproxy"

$ sudo env | grep httpproxy
http
proxy=http://username:password@192.168.0.1:80/

http://jacob.stanley.io/2010/10/27/sudo-gem-install-behind-a-proxy/