Reputation: 1
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
Reputation: 1160
Company firewalls, the bane of many a developer's existence.
Talk to the local networking team and get it unblocked for direct access.
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.
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
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