How to set proxy server for gem?

I can not install SASS via the command line.

I tried to follow the steps

c:\gem install sass 

I get 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,

+62
windows proxy rubygems
Feb 27 '14 at 5:21
source share
6 answers

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:password@your_proxy:your_port set https_proxy=https://your_proxy:your_port set https_proxy=https://username:password@your_proxy:your_port 
+133
Jan 26 '15 at 16:07
source share

You need to write this on the command line:

 set HTTP_PROXY=http://your_proxy:your_port 
+13
Jan 26 '15 at
source share

You need to add the http_proxy and https_proxy environment http_proxy as described here .

+11
Apr 23 '14 at 15:51
source share

You can try export http_proxy=http://your_proxy:your_port

+2
Oct 31 '15 at 8:02
source share

When setting up http_proxy and https_proxy, you also probably need no_proxy for URLs on one side of the proxy server. https://msdn.microsoft.com/en-us/library/hh272656(v=vs.120).aspx

0
Jan 10 '17 at 16:44
source share

In addition to @Yifei's answer. If you have a special character like @, &, $

You have to go with percent-encode | encode special characters. For example. instead of this:

 http://foo:B@r@http-gateway.domain.org:80 

you write this:

 http://foo:B%40r@http-gateway.domain.org:80 

So @ is replaced with %40 .

0
Dec 05 '17 at 10:24 on
source share



All Articles