How can I set a proxy server for gem?


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 - Errno::ECONNREFUSED: No connection could be made because the target machine actively refused it. - connect(2) (

Please help me,

This question is tagged with windows proxy rubygems

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

The Best Answer is


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


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: