From 9d900620cafc379f527ee04a338f3a7f5daf6962 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 13 Jul 2022 23:50:02 +0900 Subject: [PATCH] Set `GEM_PATH` environment variable in runruby.rb --- tool/runruby.rb | 6 ++++++ 1 file changed, 6 insertions(+) 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?