[前][次][番号順一覧][スレッド一覧]

ruby-changes:63836

From: V=C3=ADt <ko1@a...>
Date: Wed, 2 Dec 2020 12:46:43 +0900 (JST)
Subject: [ruby-changes:63836] 0ad7f2dd19 (master): Don't fail when 'RubyGems' are not available.

https://git.ruby-lang.org/ruby.git/commit/?id=0ad7f2dd19

From 0ad7f2dd19c84e44b8fd8d314de33c3e2255feb6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@r...>
Date: Wed, 18 Dec 2019 14:55:25 +0100
Subject: 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.

diff --git a/gem_prelude.rb b/gem_prelude.rb
index 1c57c94..d25cc49 100644
--- a/gem_prelude.rb
+++ b/gem_prelude.rb
@@ -1,4 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/gem_prelude.rb#L1
-require 'rubygems.rb' if defined?(Gem)
+begin
+  require 'rubygems.rb'
+rescue LoadError
+end if defined?(Gem)
 
 begin
   require 'did_you_mean'
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]