Wednesday, November 30, 2016

Fixing Ruby Gem installation issue


Today I tried installing asciidoctor gem & I got into below error.

C:\>gem install asciidoctor
ERROR:  Could not find a valid gem 'asciidoctor' (>= 0), here is why:
          Unable to download data from https://rubygems.org/ - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://api.rubygems.org/specs.4.8.gz)

This error is due to missing SSL certificate in Ruby gem. This error can be fixed by updating Ruby gem to latest version. Follow the below steps.

Simple way
  1. First find the current version of gem via gem --version command
  2. Try updating the gem version via gem update --system
  3. Now check the gem version again gem --version

Manual way
  1. First find the current version of gem via gem --version command
  2. Download the latest gem updater gem file from https://rubygems.org/pages/download
  3. Install the gem using gem install rubygems-update-2.6.8.gem
  4. Install latest version of gem via update_rubygems
  5. Now check the gem version again gem --version

Above should fix your problem with Ruby gem.


Tags: Ruby gem install failure.

No comments: