summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVít Ondruch <vondruch@redhat.com>2019-12-18 14:55:25 +0100
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2020-12-02 12:46:17 +0900
commit0ad7f2dd19c84e44b8fd8d314de33c3e2255feb6 (patch)
tree1189e78c21cacf62f4118e3e98f938a9245ea77d
parent55c9a95ac8ed1a44645cc8d7d80f2e5ebee6ec8f (diff)
Don't fail when 'RubyGems' are not available.
Although 'RubyGems' are always available in upstream Ruby, it might not be available optionally when Ruby is delivered via packaging systems. E.g. Linux distributions.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/2764
-rw-r--r--gem_prelude.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/gem_prelude.rb b/gem_prelude.rb
index 1c57c943ad..d25cc49f25 100644
--- a/gem_prelude.rb
+++ b/gem_prelude.rb
@@ -1,4 +1,7 @@
-require 'rubygems.rb' if defined?(Gem)
+begin
+ require 'rubygems.rb'
+rescue LoadError
+end if defined?(Gem)
begin
require 'did_you_mean'