From: Thomas Hurst Date: 2002-03-15T05:58:13+09:00 Subject: Re: Problems with Ruby, apache, and cgi * Michele (mycorner6@yahoo.com) wrote: > The client seems to feel his programs will only work with mod_ruby. mod_ruby provides some extra interfaces to apache, but I don't think they provide anything utterly necessary. > However, when the client tries a more complicated script: > > h = Hello.new > puts h.msg > print "Press RETURN" > $stdin.gets This makes no sense for a CGI application. Either: h = Hello.new print "Content-type: text/plain\r\n\r\n" puts h.msg Or: require cgi h = Hello.new cgi = CGI.new cgi.out { h.msg } > This fails. Note I can run the first script at the command line by > simply typing ./test.rb, but the 2nd one fails with the same error as > the website: > > ../hello.rb > ../hello.rb: Command not found. Is it in DOS format perchance? If so, it'll be trying to find "/usr/local/bin/ruby\r", and fail. > I guess my question is are there things that mod_ruby can do that a > regular ruby script can't? It can make .rb/.rhtml/whatever executable without the #! line and on directories without +ExecCGI specified. You can do the same by having the interpreter in the server cgi-bin dir and doing: AddAction ruby-script .rb AddHandler ruby-script /cgi-bin/ruby However, this introduces security issues you and your users must be aware of, so it's probably best not to bother. -- Thomas 'Freaky' Hurst - freaky@aagh.net - http://www.aagh.net/ - May the bluebird of happiness twiddle your bits.