The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,860 other subscribers

Installing ruby gems on Windows

Posted by jpluimers on 2017/11/06

Steps:

  1. Install the Ruby Installer from rubyinstaller.org/downloads
  2. Add the directory where Ruby got installed to the user PATH (using "%windir%\System32\rundll32.exe" sysdm.cpl,EditEnvironmentVariables) in my case C:\Ruby23\bin as I installed Ruby 2.3.1
  3. Install the CA certificates:
    1. Download https://curl.haxx.se/ca/cacert.pem to the Ruby directory (C:\Ruby32)
      • Note this used to be at http://curl.haxx.se/ca/cacert.pem but serving that over http instead of https does not much sense when you want to secure your connections.
    2. Add the environment variable SSL_CERT_FILE with value C:\Ruby23\cacert.pem (again using "%windir%\System32\rundll32.exe" sysdm.cpl,EditEnvironmentVariables).

If you forget step 3, then you get errors like this:

C:\Users\jeroenp>gem install gist
ERROR:  Could not find a valid gem 'gist' (>= 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)

C:\Users\jeroenp>gem update --system
ERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError)
    SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://api.rubygems.org/specs.4.8.gz)

–jeroen

References

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.