How can I set a proxy server for gem?

73

I am unable to install SASS through command prompt.

I tried below steps

c:\gem install sass

I am getting below error:

ERROR:  Could not find a valid gem 'sass' (>= 0), here is why:
          Unable to download data from https://rubygems.org/ - Errno::ECONNREFUSED: No connection could be made because the target machine actively refused it. - connect(2) (https://rubygems.org/latest_specs.4.8.gz)

Please help me,

This question is tagged with windows proxy rubygems

~ Asked on 2014-02-27 05:21:11

The Best Answer is


147

For http/https proxy with or without authentication:

Run one of the following commands in cmd.exe

set http_proxy=http://your_proxy:your_port
set http_proxy=http://username:[email protected]_proxy:your_port
set https_proxy=https://your_proxy:your_port
set https_proxy=https://username:[email protected]_proxy:your_port

~ Answered on 2015-01-26 16:07:55


19

You need to write this in the command prompt:

set HTTP_PROXY=http://your_proxy:your_port

~ Answered on 2015-01-26 14:55:34


Most Viewed Questions: