diff --git a/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb b/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb index 6050e806..1fa3688e 100644 --- a/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb +++ b/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb @@ -47,8 +47,9 @@ def require(path) alias_method(:require_relative_without_bootsnap, :require_relative) def require_relative(path) + location = caller_locations(1..1).first realpath = Bootsnap::LoadPathCache.realpath_cache.call( - caller_locations(1..1).first.absolute_path, path + location.absolute_path || location.path, path ) require(realpath) end