From c3405dcb69c79c5656636d6ba30d7a5cbf8e4d1a Mon Sep 17 00:00:00 2001 From: rulingcom Date: Sat, 2 Mar 2024 16:25:49 +0800 Subject: [PATCH] Fix bug. --- lib/process_shared/posix/libc.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/process_shared/posix/libc.rb b/lib/process_shared/posix/libc.rb index b579239..13a7345 100644 --- a/lib/process_shared/posix/libc.rb +++ b/lib/process_shared/posix/libc.rb @@ -26,7 +26,11 @@ module ProcessShared # # Fallback to attempting to load from same directory as this file. helper = 'process_shared/posix/helper.' + suffix - path = Gem::Specification.find_all.find{|g| g.name == 'process_shared'}.extensions_dir + gem_spec = Gem::Specification.find_all.find{|g| g.name == 'process_shared'} + path = gem_spec.extensions_dir + unless path.end_with?(gem_spec.full_name) + path = File.join(path, gem_spec.full_name) + end if defined?(Truffle) ffi_lib(File.join(::Truffle::Boot.toolchain_paths(:LD_LIBRARY_PATH), 'libgraalvm-llvm.so.1'), File.join(path, helper))