diff options
Diffstat (limited to 'test/ruby/envutil.rb')
-rw-r--r-- | test/ruby/envutil.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/test/ruby/envutil.rb b/test/ruby/envutil.rb index 186fcae1e..4bae3d9e3 100644 --- a/test/ruby/envutil.rb +++ b/test/ruby/envutil.rb @@ -5,9 +5,17 @@ module EnvUtil if File.exist? miniruby or File.exist? miniruby+".exe" return File.expand_path(miniruby) end - miniruby = "../"+miniruby + miniruby = File.join("..", miniruby) + end + begin + require "rbconfig" + File.join( + Config::CONFIG["bindir"], + Config::CONFIG["ruby_install_name"] + Config::CONFIG["EXEEXT"] + ) + rescue LoadError + "ruby" end - "ruby" end module_function :rubybin end |