3

I'm having trouble installing ruby gems. When I run

gem install compass

I get the following error

ERROR:  Could not find a valid gem 'compass' (>= 0), here is why: 
Unable to download data from https://rubygems.org/ 
- no such name (https://rubygems.org/latest_specs.4.8.gz)

Having tried to find the answer to this particular problem I can to the conclusion (with the help of google) that the fact I'm behind a corporate proxy is blocking the connection to Rubygems.org

So with a bit more googling I found this command that people have used to succesfully connect when behind a proxy

gem install compass --http-proxy=http://%USERNAME%:%PASSWORD%@%PROXY_SERVER%:%PROXY_PORT_NUMBER%

Having run this command substituting in the relevant information I'm not getting a different error.

ERROR:  Could not find a valid gem 'compass' (>= 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)

I've had no luck finding what could be cuasing it, can anyone help?

Alternatively does anyone know of a way to install SASS and or Compass without using a Ruby CLI?

FYI I've tried a few SASS Preprocessor apps (PREPOS) and the compass app but we need specific versions of both SASS and COMPASS for this project and i can't seem to downgrade them.

Many thanks

Lee Hitchcock
  • 85
  • 1
  • 10

2 Answers2

2

Try to use environment variables to set the proxies:

export http_proxy="http://user:pass@server.com:port"
export HTTP_PROXY="http://user:pass@server.com:port"

and then try to install the gem normally.

To test the proxy environment you can use cURL or wget:

curl -I http://stackoverflow.com
wget http://stackoverflow.com

Read this question if you want to know about the upper and lower case variable names.

Community
  • 1
  • 1
Paulo Fidalgo
  • 21,709
  • 7
  • 99
  • 115
0

Try setting your HTTP_PROXY and HTTPS_PROXY environment variables. For example:

HTTP_PROXY=http://%USERNAME%:%PASSWORD%@%PROXY_SERVER%:%PROXY_PORT_NUMBER% gem install compass
Sam Starling
  • 5,298
  • 3
  • 35
  • 52