From: Sean Chittenden Date: 2002-05-11T13:46:16+09:00 Subject: Re: Premature end of script headers > i'm new to ruby, unix, apache, and cgi, so i feel like i'm wrestling a > four headed dragon, well more like wrestling a three headed dragon and > patting a friendly goat. > i keep getting: > Premature end of script headers: > /Library/WebServer/CGI-Executables/cgiTrial2.cgi > in my apache error log. > im running os x with Marc Liyanage's distro, freshly installed. > i don't think it's not a permissions problem, the file is chmod 755'd. > my file is called cgiTrial2.cgi and contains: > > #!/usr/local/bin ruby << i think this is right? > > print "HTTP/1.0 200 OK\r\n" > print "Content-type: text/html\r\n\r\n" > print "Hello World!\r\n" > > this is saved as an asci file w/ unix breaks. > any ideas? Few things: 1) Do you have access to your error logs? 2) Are you running mod_ruby? 3) Remove the 'HTTP/1.0 200 OK' from your script, that's taken care of by apache. 4) Try the following: #!/usr/local/bin/ruby print "Content-Type: text/plain\r\n\r\n" puts "Hello World" 5) Any chance you could install/use mod_ruby? :~) -sc -- Sean Chittenden