Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 250
user3358928 Avatar asked Feb 27 '14 05:02

user3358928


People also ask

What is GEM server?

RubyGems is a package manager for the Ruby programming language that provides a standard format for distributing Ruby programs and libraries (in a self-contained format called a "gem"), a tool designed to easily manage the installation of gems, and a server for distributing them.

What is a gem dependency?

development. RubyGems provides two main “types” of dependencies: runtime and development. Runtime dependencies are what your gem needs to work (such as rails needing activesupport). Development dependencies are useful for when someone wants to make modifications to your gem.


2 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 
like image 96
Yifei Avatar answered Oct 27 '22 10:10

Yifei


You need to write this in the command prompt:

set HTTP_PROXY=http://your_proxy:your_port 
like image 23
Dayli Suarez Sanchez Avatar answered Oct 27 '22 10:10

Dayli Suarez Sanchez