Index: lib/webrick/httpservlet/cgihandler.rb =================================================================== --- lib/webrick/httpservlet/cgihandler.rb (revision 22025) +++ lib/webrick/httpservlet/cgihandler.rb (working copy) @@ -20,13 +20,16 @@ Ruby = File::join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name']) Ruby << RbConfig::CONFIG['EXEEXT'] - CGIRunner = "\"#{Ruby}\" \"#{WEBrick::Config::LIBDIR}/httpservlet/cgi_runner.rb\"" + CGIRunnerExec = "\"#{WEBrick::Config::LIBDIR}/httpservlet/cgi_runner.rb\"" + CGIRunner = "\"#{Ruby}\" #{CGIRunnerExec}" + def initialize(server, name) super(server, name) @script_filename = name @tempdir = server[:TempDir] - @cgicmd = "#{CGIRunner} #{server[:CGIInterpreter]}" + cmd = server[:CGIRuby] ? "#{server[:CGIRuby]} #{CGIRunnerExec}" : CGIRunner + @cgicmd = "#{cmd} #{server[:CGIInterpreter]}" end def do_GET(req, res) Index: test/webrick/test_cgi.rb =================================================================== --- test/webrick/test_cgi.rb (revision 22025) +++ test/webrick/test_cgi.rb (working copy) @@ -8,6 +8,7 @@ def start_cgi_server(&block) config = { :CGIInterpreter => TestWEBrick::RubyBin, + :CGIRuby => TestWEBrick::RubyBin, :DocumentRoot => File.dirname(__FILE__), :DirectoryIndex => ["webrick.cgi"], :RequestHandler => Proc.new{|req, res| Index: test/webrick/test_filehandler.rb =================================================================== --- test/webrick/test_filehandler.rb (revision 22025) +++ test/webrick/test_filehandler.rb (working copy) @@ -173,6 +173,7 @@ def test_script_disclosure config = { :CGIInterpreter => TestWEBrick::RubyBin, + :CGIRuby => TestWEBrick::RubyBin, :DocumentRoot => File.dirname(__FILE__), :CGIPathEnv => ENV['PATH'], }