Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

Failing to install Ruby gems

I am having problems installing ruby gems on my Windows machine. I keep on receiving this error:

ERROR: Could not find a valid gem 'rails' ()=0), here is why: Unable to download data from https://rubygems.org/-Errno::ETIMEDOUT: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.- connect(2) for "api.rubygems.org" port 443 (https://api.rubygems.org/latest_specs.4.8.gz)

2 Answers

Looks like a network issue. Checking the rubygems.org status page they don't appear to be having any issues on their end right now, but that doesn't mean they weren't experiencing something a few hours ago when you were trying to install.

Do you usually connect to the internet via a proxy or VPN? Were you experiencing other network issues around this time?

Best advice I can give for now is just try again and see if you get the same result.

I connect to the internet via proxy but my internet i very slow. Is there any other way I can install ruby gems off-line because I have tried many times without success.

It might just be that you need to setup bundler to use your proxy, here's a Stack Overflow thread on how to use bundler behind a proxy.

If all else fails you can always download the gems yourself either on the same machine if you have better luck downloading directly or on another machine and bringing the .gem files with you on a USB stick. To install a local gem file use

  gem install --local gemfile.gem

Where "gemfile.gem" is the name of the gem you downloaded. If you're working with a bundler Gemfile it should detect that you have already installed the gems. Just be careful to download the versions specified in your Gemfile.

Hope you get things working! Good luck.

Thank you!