2

Initially, I have ruby 1.9.3 version installed in my windows 7 and i have installed ruby 2.0.0p195 recently and have tested from command promot (ruby -v; ruby -e "puts 100"; irb )works pretty well.

ruby -v gives ruby 2.0.0p195 (2013-05-14) [i386-mingw32]

gem -v gives me 2.0.2

When i'm trying to install rails, I do always get the below error :

with http://rubygems.org

C:\Users\san>gem install rails --source http://rubygems.org
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 respon
d after a period of time, or established connection failed because connected hos
t has failed to respond. - connect(2) (https://rubygems.org/latest_specs.4.8.gz)

or

with https://rubygems.org

C:\Users\san>gem install rails --debug -V
Exception `Errno::EEXIST' at C:/Ruby200/lib/ruby/2.0.0/fileutils.rb:245 - File e
xists - C:/Users/san/.gem/specs/rubygems.org%443
HEAD https://rubygems.org/latest_specs.4.8.gz
Exception `OpenSSL::SSL::SSLError' at C:/Ruby200/lib/ruby/2.0.0/openssl/bufferin
g.rb:174 - read would block
302 Moved Temporarily
HEAD https://s3.amazonaws.com/production.s3.rubygems.org/latest_specs.4.8.gz
Exception `OpenSSL::SSL::SSLError' at C:/Ruby200/lib/ruby/2.0.0/openssl/bufferin
g.rb:174 - read would block
200 OK
GET https://rubygems.org/latest_specs.4.8.gz
Exception `Errno::ETIMEDOUT' at C:/Ruby200/lib/ruby/2.0.0/net/http.rb:878 - A co
nnection attempt failed because the connected party did not properly respond aft
er a period of time, or established connection failed because connected host has
 failed to respond. - connect(2)

Since i'm getting so many errors, I have uninstalled both ruby versions and rebooted system and installed back (as suggested after googling and from few stackoverflow questions). But didn't help much. Note: I have turned off windows firewall and tried installing. But I'm still getting Exception with openSSL issue. Please suggest on this. Thanks!

San
  • 223
  • 1
  • 6
  • 15

1 Answers1

3

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
Thalaivar
  • 23,282
  • 5
  • 60
  • 71
Chubby Boy
  • 30,942
  • 19
  • 47
  • 47
  • I tried already, output is as below : `C:\Users\san>gem install rails --http-proxy ... I get --> ERROR: Could not find a valid gem 'rails' (>= 0), here is why: Unable to download data from https://rubygems.org/ - SSL_connect SYSCA LL returned=5 errno=0 state=SSLv3 read server session ticket A (https://rubygems .org/latest_specs.4.8.gz)` – San Jun 08 '13 at 05:34
  • yes.. I have tried.. same error Exception `OpenSSL::SSL::SSLError' – San Jun 08 '13 at 05:51
  • This time i'm getting an additional error `A non-blocking socket operation could not be completed immediately - read would block` – San Jun 08 '13 at 05:53
  • It worked now... `gem install rails --http-proxy --source http://rubygems.org --debug -v` – San Jun 10 '13 at 04:53
  • @San I tried. It gave this: ** Exception `LoadError' at /Users/hesham/.rbenv/versions/2.1.2/lib/ruby/2.1.0/resolv.rb:169 - LoadError Exception `OptionParser::MissingArgument' at /Users/hesham/.rbenv/versions/2.1.2/lib/ruby/2.1.0/optparse.rb:491 - missing argument: Exception `OptionParser::MissingArgument' at /Users/hesham/.rbenv/versions/2.1.2/lib/ruby/2.1.0/optparse.rb:1393 - missing argument: -v ERROR: While executing gem ... (OptionParser::MissingArgument) missing argument: -v /Users/hesham/.rbenv/versions/2.1.2/lib/ruby/2.1.0/optparse.rb:491:in `parse' .... ....** Please advise – Hesham Aug 15 '14 at 20:29