From b45f7a54aff65eb37d60264f8dcbbc18587b9855 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Fri, 15 Nov 2024 13:13:23 +0900 Subject: [PATCH] Find .ext/common path from LOAD_PATH for out-of-place build --- lib/bundled_gems.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/bundled_gems.rb b/lib/bundled_gems.rb index 9b0fc90a27..2a00e83a46 100644 --- a/lib/bundled_gems.rb +++ b/lib/bundled_gems.rb @@ -55,7 +55,8 @@ module Gem::BUNDLED_GEMS conf = ::RbConfig::CONFIG if ENV["TEST_BUNDLED_GEMS"] LIBDIR = (File.expand_path(File.join(__dir__, "..", "lib")) + "/").freeze - ARCHDIR = (File.expand_path(File.join(__dir__, "..", ".ext/common")) + "/").freeze + rubyarchdir = $LOAD_PATH.find{|path| path.include?(".ext/common") } + ARCHDIR = (File.expand_path(rubyarchdir) + "/").freeze else LIBDIR = (conf["rubylibdir"] + "/").freeze ARCHDIR = (conf["rubyarchdir"] + "/").freeze