The error message:
openssl::ssl::sslerror: ssl_connect returned=1 errno=0 state=sslv3 read server certificate b: certificate verify failed
or
could not load openssl. you must recompile ruby with openssl support or change the sources in your gemfile from 'https' to 'http'. instructions for compiling with openssl using rvm are available at rvm.io/packages/openssl.
or
ERROR: Could not find a valid gem 'rails' (= 5.2.1), here is why: Unable to download data from https://rubygems.org/ - SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: tlsv1 alert protocol version (https://rubygems.org/specs.4.8.gz)
Using the RVM (Ruby Version Manager), whichs include a utility to diagnose and resolve errors caused by outdated certificate files.
$ rvm -v
# rvm 1.29.4 (stable)
$ rvm osx-ssl-certs status all
# Certificates for...
$ rvm osx-ssl-certs update all
# Updating certificates...
When the certificate files again become outdated, the error may reappear. To keep the certificate files current, RVM offers an option to run a cron job that updates the certificate files daily.
$ sudo rvm osx-ssl-certs cron install
The SSL certificates that comes with Mac OS X 10.8 may be outdated. You can install Homebrew and try this:
$ brew update
$ brew install openssl
$ brew link openssl --force
$ brew install curl-ca-bundle
$ brew tap raggi/ale
$ brew install openssl-osx-ca