ERROR: while executing gem ... (OpenSSL :: X509 :: StoreError)

I tried to install serialport on Windows 7 as administrator however I ran into the error:

C:\Sites>gem install serialport
ERROR: While executing gem ... (OpenSSL::X509::StoreError)

      

I tried the following, but they didn't help:

I tried to find this solution from the internet. However, it still doesn't work. Any ideas?

Below is the gem environment for my PC:

C:\Sites>gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 2.2.2
  - RUBY VERSION: 2.1.5 (2014-11-13 patchlevel 273) [i386-mingw32]
  - INSTALLATION DIRECTORY: C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0
  - RUBY EXECUTABLE: C:/RailsInstaller/Ruby2.1.0/bin/ruby.exe
  - EXECUTABLE DIRECTORY: C:/RailsInstaller/Ruby2.1.0/bin
  - SPEC CACHE DIRECTORY: C:/Users/5004118294/.gem/specs
  - RUBYGEMS PLATFORMS:
  - ruby
  - x86-mingw32

C:\Sites>gem which openssl
openssl Directory: C:\RailsInstaller\Ruby2.1.0\ruby\2.1.0\openssl.rb

      

thank

+3


source to share


3 answers


Try this on the command line

ruby -ropenssl -e 'puts OpenSSL::X509::DEFAULT_CERT_FILE'

      



Also see OpenSSL :: X509 :: StoreError: cert already in the hash table? and SSL error while installing rubygems, Failed to retrieve data from https://rubygems.org/ .

0


source


Maybe the SSL_CERT_FILE environment variable is wrong. Just remove the variable and try it.



0


source


To fix this error, I just added the SSL_CERT_FILE variable to my System Environment. A type

sysdm.cpl

at the command line to go to the system environment.

In user variables Sets the SSL directory and file location to the known ssl certificate directory. I have installed my Git bash

SSL_CERT_DIR = C:\Program Files\Git\mingw64\ssl\certs

SSL_CERT_FILE = C:\Program Files\Git\mingw64\ssl\cert.pem

enter image description here

You can use this great tool here to check if you can connect to https. https://github.com/mislav/ssl-tools

0


source







All Articles