From: Shugo Maeda Date: 2000-12-19T18:10:02+09:00 Subject: [ruby-talk:7667] Re: mod_ruby Hi, At Mon, 18 Dec 2000 04:00:03 GMT, Jeremy C wrote: > Anyway, I made a simple ruby script (as simple as you can get for a cgi): > > print "Hello from Ruby!" > > and Netscape and Lynx would not display anything saying that the page had no > content. If I add the line: > > print "Content-type: text/html\r\n\r\n" > > to the top of the script, it now display's the Hello from Ruby! but it also > display's Content-type: text/html at the top.. mod_ruby is compatible with NPH-CGI, and does not output the HTTP status line. So you have to output the HTTP status line by yourself. print "HTTP/1.1 200 OK\r\n" print "Content-Type: text/plain\r\n\r\n" print "hello world" Or you can use cgi.rb. I recommand this method. require 'cgi' cgi = CGI.new print cgi.header("type"=>"text/plain") print "hello world" Shugo