19 Jul 2017
SSL_Connect Certificate Error with Ruby Fix
While setting up a static environment, I came across this error from running:
gem install github-pages (a gem for syncing Jekyll with GitHub Pages):
The problem came from outdated SSL certificates, as explained by Fletcher Nichol in this gist.
A solution was to temporarily replace the https source with http.
gem sources -r https://rubygems.org/ gem sources -a http://rubygems.org/
gem install github-pages
And then restore the SSL.
gem sources -r http://rubygems.org/ gem sources -a https://rubygems.org/
This was a quick fix, however, using http over https raised security concerns since http didn't include the SSL encryption when installing gems.
- Download the certificate authority cacert.pem file
- Save it to the RailsInstaller folder located in the (C:)
- Set an environment variable identifying the file path.
To set an environment variable:
Go to the Control Panel, System and Security, System, and Advanced System Settings. Click on Environment Variables...
Click OK, close the control panel and re-lanch the command line.
Following this, I was able to install github-pages with success, CD to my project folder and successfully run
jekyll server --watch without error.