From: page77.office@... Date: 2006-01-05T06:42:59+09:00 Subject: Re: Newbie tearing hair out Many thanks to all who responded. It turned out that the problem was that apache was configured to execute cgi scripts, but I did not have the right first line. For Windows/DOS the correct first line is #! /ruby/bin/ruby.exe or wherever your path to ruby is. The important part is to include the .exe and use forward slashes / I can now test my ruby scripts, by having them end in .cgi I will investigate getting .rb to work based on your help. Thanks to all - Richard James Britt wrote: > Walter Prins wrote: > > I think you need to configure apache to know that .rb extension files > > are to be treated as CGI scripts to be run via the Rub interpreter (or > > module.) (Note I have no experience with this setup, just limited > > general experience with this sort of thing with Apache. ) Basically > > you want to look into the Apache "ScriptAlias" directive and/or > > "ExecCGI" option. See here: > > http://www.serverwatch.com/tutorials/article.php/1128971 > > > > Also you need to tell apache to add a handler for .rb files, for this > > look into AddHandler directive. See e.g. here: > > http://www.ricocheting.com/server/cgi.html > > > > > You'll need something like this in either a .htaccess file in the Web > app's document root directory, or in the httpd.conf file: > > > > SetHandler cgi-script > > > Options +ExecCGI > DirectoryIndex index.cgi index.rb index.html > > > Also note that Apache on Windows can be configured in two different ways > to execute CGI scripts. In one approach, it looks at the #! line to > locate the interpreter, In the other, it ignores that line and just > uses whatever app is associated with the file extension of the scripts. > > > James > > > > -- > > http://www.ruby-doc.org - Ruby Help & Documentation > http://www.artima.com/rubycs/ - Ruby Code & Style: Writers wanted > http://www.rubystuff.com - The Ruby Store for Ruby Stuff > http://www.jamesbritt.com - Playing with Better Toys > http://www.30secondrule.com - Building Better Tools