From: Brian Candler Date: 2011-03-22T18:03:44+09:00 Subject: Re: Run CGI scripts in own webserver Kevin DeValck wrote in post #988602: > Does anybody know how I can run ruby cgi scripts in my web server. I > coded the webserver myself in ruby. You need to implement the (obsolete) CGI spec yourself in your server: http://w3.org/CGI/ http://graphcomp.com/info/specs/cgi11.html See also RFC 3875 You could spawn the process yourself using IO.popen, but the trouble is setting the environment variables first in a thread-safe way. Probably better to use IO.pipe, fork and exec. Look at the source for open3.rb in the standard library. I'm sure this will be an interesting learning exercise about how CGI works, but most people have abandoned CGI anyway because it's hugely inefficient. So if I were you, I'd be looking at Rack instead, or at least FastCGI or SCGI. HTH, Brian. -- Posted via http://www.ruby-forum.com/.