From: Chris Gehlker Date: 2002-05-11T06:47:17+09:00 Subject: Re: Premature end of script headers On 5/10/02 2:23 PM, "Irv Mullins" wrote: > ccos wrote: > >> hello, >> 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? > > First find out where it is: >> which ruby > /usr/bin/ruby > > Then, for me, at least, I had to change the first line > to: > #!/usr/bin/ruby (get rid of the space before ruby) > > and it works. > > Regards, > Irv > Sometimes the 'one click installers' don't put stuff in the same place as 'sudo make install' puts it. Sometimes people move it for reasons of their own. That's why it is better to use: #!/usr/bin/env ruby #note the space before ruby This seems to work everywhere. -- The secret of life is honesty and fair dealing. If you can fake that, you've got it made. -Groucho Marx