Gem Install Rails Doesn't Work Due to Openssl/Etimedout in Windows

gem install rails doesn't work due to openssl/ETimedout in windows

The problem could be because you are behind proxy/firewall that blocks you from downloading from rubygems.org. See the below thread on rubygems.org for similiar issue:

http://help.rubygems.org/discussions/problems/799-ruby-gem-install-problems-on-windows-xp

Try using --http-proxy option while installing.

For people who are not able to make it work through --http-proxy, try the below. Added from the comment below.

gem install rails --http-proxy --source http://rubygems.org --debug -v

SSL Error When installing rubygems, Unable to pull data from 'https://rubygems.org/

For RVM & OSX users

Make sure you use latest rvm:

rvm get stable

Then you can do two things:

  1. Update certificates:

    rvm osx-ssl-certs update all
  2. Update rubygems:

    rvm rubygems latest

For non RVM users

Find path for certificate:

cert_file=$(ruby -ropenssl -e 'puts OpenSSL::X509::DEFAULT_CERT_FILE')

Generate certificate:

security find-certificate -a -p /Library/Keychains/System.keychain > "$cert_file"
security find-certificate -a -p /System/Library/Keychains/SystemRootCertificates.keychain >> "$cert_file"

The whole code: https://github.com/wayneeseguin/rvm/blob/master/scripts/functions/osx-ssl-certs


For non OSX users

Make sure to update package ca-certificates. (on old systems it might not be available - do not use an old system which does not receive security updates any more)

Windows note

The Ruby Installer builds for windows are prepared by Luis Lavena and the path to certificates will be showing something like C:/Users/Luis/... check https://github.com/oneclick/rubyinstaller/issues/249 for more details and this answer https://stackoverflow.com/a/27298259/497756 for fix.



Related Topics



Leave a reply



Submit