Trying to learn CGI, please help, total newbie lost

b10m at
Sat Feb 13 13:46:58 GMT 2021

On Sat, Feb 13, 2021 at 02:21:19PM +0100, Omar Polo wrote:
> Miguel de Luis Espinosa <enteka at> writes:
> > OK, so, I've never done this kind of thing before, just PHP'd
> > websites or using sinatra (ruby) that would take care of the
> > "small details" for you.
> >
> > So I tried this on a space I have on the tilde
> >
> > ``` #!/usr/bin/ruby
> >
> > p "20 SUCCESS\n\r" # also tried puts
> I don't know how works, what server they use etc.  But
> this (if it's not a copy-paste error) looks wrong.  Instead of
> "SUCCESS" you should put a media type there, like text/gemini.
> Also, the \n and \r are in the wrong order, \r comes first.  (puts
> should add a \n by itself at the end, so `puts "20 text/gemini\r"`
> should be enough).

Also note that `p` is used for debugging (IIRC; I don't know ruby
often). You probably want `print` (or `puts`, to add a newline

So either:

puts "20 text/gemini\r\n"


print "20 text/gemini\r\n\n"


More information about the Gemini mailing list