Skip to content

Instantly share code, notes, and snippets.

@havenwood
Created February 16, 2015 23:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save havenwood/9cd08a0b66b75d726ef6 to your computer and use it in GitHub Desktop.
Save havenwood/9cd08a0b66b75d726ef6 to your computer and use it in GitHub Desktop.
Install a trust certificate to fix `SSL_connect returned=1 errno=0` for old RubyGems
require 'open-uri'
URL = 'https://raw.githubusercontent.com/rubygems/rubygems/master/lib/rubygems/ssl_certs/'
FILENAME = 'AddTrustExternalCARoot-2048.pem'
DIR = File.join RbConfig::CONFIG['rubylibdir'], 'rubygems', 'ssl_certs'
pem = open File.join(URL, FILENAME), &:read
File.write File.join(DIR, FILENAME), pem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment