title: Setting up Ruby CGI in Apache
body: <p>I want to use Ruby in Apache through CGI. I have the following in my configuration file:</p>
  
  <pre><code>DocumentRoot /home/ceriak/ruby
  
  &lt;Directory /home/ceriak/ruby&gt;
      Options +ExecCGI
      AddHandler cgi-script .rb
  &lt;/Directory&gt;
  </code></pre>
  
  <p><code>test.rb</code> is a testfile placed under <code>/home/ceriak/ruby/</code>, <code>#!/usr/bin/ruby</code> included on the first line and given executable permissions. Still, when I visit <code>localhost/test.rb</code> I get a download window and can obtain the source code.</p>
  
  <p>Interestingly, when I place the same script under <code>/usr/lib/cgi-bin/</code> and call <code>localhost/cgi-bin/test.rb</code> it works as supposed.</p>
  
  <p>(Apache2 on Ubuntu 9.10.)</p>
  
  <p>Any idea?</p>