diff --git a/lib/derailed_benchmarks/core_ext/kernel_require.rb b/lib/derailed_benchmarks/core_ext/kernel_require.rb index 2983966..5f83377 100644 --- a/lib/derailed_benchmarks/core_ext/kernel_require.rb +++ b/lib/derailed_benchmarks/core_ext/kernel_require.rb @@ -35,7 +35,8 @@ def require_relative(file) if Pathname.new(file).absolute? require file else - require File.expand_path("../#{file}", caller_locations(1, 1)[0].absolute_path) + path = caller_locations(1, 1)[0].absolute_path || caller_locations(1, 1)[0].path + require File.expand_path("../#{file}", path) end end