From: GOTOU Yuuzou Date: 2003-09-23T04:17:48+09:00 Subject: Re: Webrick & CGI programs on WinXP In message <200392213938.486535@PADD>, `Austin Ziegler ' wrote: > I'm attempting to get ruwiki running under WEBrick on Windows XP. It's not > working, so I am attempting with a very simple CGI script. Well, that isn't > working, either. > > I'm starting WEBrick with: > ---------------- > #!/usr/local/bin/ruby > require 'webrick' > include WEBrick > > s = HTTPServer.new(:Port => 2000, :DocumentRoot => Dir::pwd + "/htdocs") > > # mount subdirectories > s.mount("/ruwiki", HTTPServlet::CGIHandler, "C:/Apps/Ruby18/bin/ruby.exe") > > trap("INT"){ s.shutdown } > s.start > ---------------- Could you apply the attached patch? And if same error occurs again, please increase the sleep time. (Windows doesn't allow deleting opened files. This patch makes it delay to wait for exiting of child process.) and try it. require 'webrick' include WEBrick s = HTTPServer.new( :Port => 2000, :DocumentRoot => Dir::pwd + "/htdocs", :CGIInterpreter => "C:/Apps/Ruby18/bin/ruby.exe" ) s.mount("/rwiki", HTTPServlet::FileHandler, "/path/of/script-dir") s.start When CGIHandler is mounted on server directly, third argument of mount() is expexted to be a pathname of script. s.mount("/rwiki", HTTPServlet::CGIHandler, "/path/of/script.cgi") -- gotoyuzo diff -u -p -r1.1 cgihandler.rb --- lib/webrick/httpservlet/cgihandler.rb 23 Jul 2003 16:51:36 -0000 1.1 +++ lib/webrick/httpservlet/cgihandler.rb 22 Sep 2003 18:17:52 -0000 @@ -55,6 +55,7 @@ module WEBrick ensure cgi_in.close status = $? >> 8 + sleep 0.1 data = cgi_out.read cgi_out.close(true) if errmsg = cgi_err.read