summaryrefslogtreecommitdiff
path: root/tool/runruby.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2022-07-13 23:50:02 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2022-07-14 09:00:13 +0900
commit9d900620cafc379f527ee04a338f3a7f5daf6962 (patch)
tree64eac3de87ff8b6bba6093381ce6854796f0db30 /tool/runruby.rb
parent416cba90c1610f54dafd91234de9ec74d73ae22c (diff)
Set `GEM_PATH` environment variable in runruby.rb
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/6130
Diffstat (limited to 'tool/runruby.rb')
-rwxr-xr-xtool/runruby.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/tool/runruby.rb b/tool/runruby.rb
index bff5d031cc..d9a4c855d3 100755
--- a/tool/runruby.rb
+++ b/tool/runruby.rb
@@ -122,6 +122,12 @@ if e = ENV["RUBYLIB"]
end
env["RUBYLIB"] = $:.replace(libs).join(File::PATH_SEPARATOR)
+gem_path = [abs_archdir, srcdir].map {|d| File.realdirpath(".bundle", d)}
+if e = ENV["GEM_PATH"]
+ gem_path |= e.split(File::PATH_SEPARATOR)
+end
+env["GEM_PATH"] = gem_path.join(File::PATH_SEPARATOR)
+
libruby_so = File.join(abs_archdir, config['LIBRUBY_SO'])
if File.file?(libruby_so)
if e = config['LIBPATHENV'] and !e.empty?