From: TAKAHASHI Masayoshi Date: 2003-05-07T13:36:24+09:00 Subject: Re: Does webrick 1.2.3 work with ruby-1.8.0? Hi, Jim Freeze wrote: > I get the following error with WEBrick 1.2.3 and Ruby-1.8.0 while > trying to open the test.cgi script. > > Internal Server Error > > closed stream > > WEBrick/1.2.3 (2002-09-23) (Ruby/1.8.0/2003-04-10) at 157.95.47.65:10020 > > > Is this a known issue? Does it have a fix? Current (not-stable) version in CVS seems to be fixed. (http://www.webrick.org/#download) Here is a patch for webrick-1.2.3: --- cgihandler.rb.org 2002-09-21 21:23:41.000000000 +0900 +++ cgihandler.rb 2003-05-07 11:37:25.000000000 +0900 @@ -32,7 +32,7 @@ data = nil status = -1 - IO::popen(@cgicmd, "w"){|cgi_in| + cgi_in = IO::popen(@cgicmd, "w") cgi_out = Tempfile.new("webrick.cgiout.", @tempdir) cgi_err = Tempfile.new("webrick.cgierr.", @tempdir) begin @@ -52,9 +52,9 @@ if req.body and req.body.size > 0 cgi_in.write(req.body) end + ensure cgi_in.close status = $? >> 8 - ensure data = cgi_out.read cgi_out.close(true) if errmsg = cgi_err.read @@ -64,7 +64,6 @@ end cgi_err.close(true) end - } if status != 0 @logger.error("CGIHandler: #{@script_filename} exit with #{status}") end Hope this helps, TAKAHASHI 'Maki' Masayoshi (maki@rubycolor.org)