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:
Update certificates:
rvm osx-ssl-certs update all
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
Why Is My Ruby Git Script Hook Run with the Wrong $Path
Gets.Chomp Without Moving to a New Line
Compass Error for Command 'Grunt Server'
Ruby Outputting to the Same Line as the Previous Output
Should Gemfile.Lock Be Committed to Source Control on Windows
How to Install Libksba on MAC Osx
Undefined Method 'Require_Relative' for Main:Object (Nomethoderror)
Rails User Profile Page Only Accessible to Correct User
Best Way to Find_Or_Create_By_Id But Update the Attributes If the Record Is Found
Rails Query Timestamp Between Two Hours
Why Is 032 Different Than 32 in Ruby
How to "Extract" Values from a Multidimensional Array in a Smart Way
Rails Is Not Using My Global Ruby Version
Ruby Spreadsheet Row Background Color
Ruby: Why Does '#Hash' Need to Overridden Whenever '#Eql' Is Overridden