Blob Blame Raw
From c16675582a68800ef17b6056110e0a8bcdb38b55 Mon Sep 17 00:00:00 2001
From: SHIBATA Hiroshi <hsbt@ruby-lang.org>
Date: Tue, 22 Jan 2019 09:37:23 +0900
Subject: [PATCH] Avoid rdoc hook when it's failed to load rdoc library.

  Fixed #2483
---
 lib/rubygems/rdoc.rb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/rubygems/rdoc.rb b/lib/rubygems/rdoc.rb
index dfaf7c55bf..4e16fbb86f 100644
--- a/lib/rubygems/rdoc.rb
+++ b/lib/rubygems/rdoc.rb
@@ -18,7 +18,7 @@
   module Gem
     RDoc = ::RDoc::RubygemsHook
   end
+
+  Gem.done_installing(&Gem::RDoc.method(:generation_hook))
 rescue LoadError
 end
-
-Gem.done_installing(&Gem::RDoc.method(:generation_hook))