# File lib/cgikit/project/command.rb, line 66 def default_ruby_path ruby = File.join(Config::CONFIG['bindir'], Config::CONFIG['ruby_install_name']) if FileTest::file?(ruby) and FileTest::executable?(ruby) return ruby end begin %x(which ruby).chomp rescue Exception => e # for windows paths = ENV['PATH'].split(':') exts = ['', '.com', '.exe', '.bat', '.cmd', '.vbs', '.js', '.wsf'] paths.each do |path| exts.each do |ext| command = File.join(path, "ruby#{ext}") if FileTest.exist?(command) then return command end end end raise "Can't find ruby" end end