sajal
sajal

Reputation: 1

i cannot install haml using "gem install haml"

i have already downloaded ruby 2.2.1 and in command prompt i hv tried the command

gem install haml

but error is coming like:

ERROR: Could not find a valid gem 'haml' (>= 0), here is why: Unable to download data from https://rubygems.org/ - Errno::ECONNREFUS ED: No connection could be made because the target machine actively refused it. - connect(2) for "api.rubygems.org" port 443 (https://api.rubygems.org/specs.4.8 .gz)

It might be because of the firewall company have put up in every system. I have gone through trying different proxies picked up from different websites. Can anybody tell how to install or use haml/sass?

Upvotes: 0

Views: 811

Answers (2)

Mikey T.K.
Mikey T.K.

Reputation: 1160

Company firewalls, the bane of many a developer's existence.

The best thing you can do:

Talk to the local networking team and get it unblocked for direct access.

If that fails:

Do they have a proxy you can use? gem will honor proxy variables, so if you get access to one, you can do an export https_proxy="http://someaddress:someport", and then your command should work.

If that also fails

Now we're left with circumventing the network policies - Be careful, as this could get you in trouble.

Options include:

  • Getting an external proxy that allows port 80 (it sounds like 80 works from your question). You could set up a squid instance on your home machine and access it that way via the variable method above.

  • Doing an SSH tunnel through a machine that does have unrestricted internet access, and using tsocks to tunnel through there.

There are others, but these two are relatively easy to set up.

I must emphasize here, be careful! Even if your networking group is impeding your ability to do your job, either get your boss's support, or be as stealthy as possible and discontinue use of these tools once you have what you need.

Upvotes: 1

Fabien Dobat
Fabien Dobat

Reputation: 118

If it's a rails project, you can try to change the first line of your Gemfile from source 'https://rubygems.org' to source 'http://rubygems.org'.

If you are using a ruby project, try to download gem without https, like : gem install -s http://rubygems.org haml

Upvotes: 0

Related Questions