Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to install any gem by Ruby in Windows

I've installed rubyinstaller-2.0.0-p195 in my PC and opened command prompt with Ruby. next i ran gem update --system command to update and updated successfully.

Now, whenever I tried to run gem install <program>, eg. gem install rhc, gem install af, its fails to install every time and shows similar SSL_certificate related error as shown below -

C:\Windows\System32>gem install rhc
ERROR:  Could not find a valid gem 'rhc' (>= 0), here is why:
          Unable to download data from https://rubygems.org/ - SSL_connect retur
ned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (
https://rubygems.global.ssl.fastly.net/quick/Marshal.4.8/rhc-1.15.6.gemspec.rz)
ERROR:  Possible alternatives: rhc
like image 445
Sukanta Paul Avatar asked Nov 02 '13 19:11

Sukanta Paul


People also ask

Where are RubyGems installed Windows?

When you use the --user-install option, RubyGems will install the gems to a directory inside your home directory, something like ~/. gem/ruby/1.9. 1 . The commands provided by the gems you installed will end up in ~/.


2 Answers

RubyGems fetches gems from the sources you have configured (stored in your ~/.gemrc). The default source is https://rubygems.org.

But you can execute the following commands: *

gem sources --remove https://rubygems.org/
gem sources --add http://rubygems.org/

──────────────
* If you want to reset to the «factory settings»:
       gem sources --remove http://rubygems.org/
       gem sources --add https://rubygems.org/

like image 116
Paul Vargas Avatar answered Oct 05 '22 00:10

Paul Vargas


This is most likely due to running over a secure (https) connection to rubygems.org. Look at the help for “gem sources –h”, remove the https version and add http://rubygems.org

like image 25
Mitch Avatar answered Oct 04 '22 23:10

Mitch