From bc991856808780d4ff6d697d11fb200263a3d28b Mon Sep 17 00:00:00 2001 From: Don Reilly Date: Fri, 17 Jul 2015 14:18:08 -0500 Subject: [PATCH] Forcibly load OpenSSL to handle autoloading issues in net/http/persistent on some Rubies --- lib/rubygems/mirror/fetcher.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/rubygems/mirror/fetcher.rb b/lib/rubygems/mirror/fetcher.rb index 928baef..4abc8a6 100644 --- a/lib/rubygems/mirror/fetcher.rb +++ b/lib/rubygems/mirror/fetcher.rb @@ -1,3 +1,11 @@ +# We forcibly require OpenSSL, because net/http/persistent will only autoload +# it. On some Rubies, autoload fails but explicit require succeeds. +begin + require 'openssl' +rescue LoadError + # some Ruby builds don't have OpenSSL +end + require 'net/http/persistent' require 'time'