# Can't get Apache2 to i interpret my ruby file

**URL:** <https://www.ruby-forum.com/t/cant-get-apache2-to-i-interpret-my-ruby-file/84080>\
**Category:** Ruby\
**Created:** [February 1, 2007, 5:55am UTC](https://www.ruby-forum.com/t/cant-get-apache2-to-i-interpret-my-ruby-file/84080 "2007-02-01T05:55:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [February 1, 2007, 5:55am UTC](https://www.ruby-forum.com/t/cant-get-apache2-to-i-interpret-my-ruby-file/84080/1 "2007-02-01T05:55:38Z")

</div>

Hi,

I have Apache 2.2 installed on my Fedora Core 5 Linux machine. I  
created this file, “test.rb” at my public document root

#!/usr/local/bin/ruby  
print “Content-type: text/html\r\n\r\n”  
print “Hello everybody!!!\r\n”

and when i visit [http://mydomain.com/test.rb](http://mydomain.com/test.rb), the output is

#!/usr/local/bin/ruby  
print “Content-type: text/html\r\n\r\n”  
print “Hello SAm and Lisa!!!\r\n”

That’s right, it’s just the same file. So my question is, what  
directives to I need to add to my “httpd.conf” file to make this file  
interpret? I am surprised by how little documentation there is on how  
to do this.

Thanks, - Dave

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [February 1, 2007, 7:19am UTC](https://www.ruby-forum.com/t/cant-get-apache2-to-i-interpret-my-ruby-file/84080/2 "2007-02-01T07:19:41Z")

</div>

[http://httpd.apache.org/docs/1.3/howto/cgi.html](http://httpd.apache.org/docs/1.3/howto/cgi.html)

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [February 1, 2007, 7:21am UTC](https://www.ruby-forum.com/t/cant-get-apache2-to-i-interpret-my-ruby-file/84080/3 "2007-02-01T07:21:00Z")

</div>

removed\_email\_address@domain.invalid wrote:

> Hi,
> 
> I have Apache 2.2 installed on my Fedora Core 5 Linux machine. I  
> created this file, “test.rb” at my public document root
> 
> #!/usr/local/bin/ruby  
> print “Content-type: text/html\r\n\r\n”  
> print “Hello everybody!!!\r\n”
> 
> and when i visit [http://mydomain.com/test.rb](http://mydomain.com/test.rb), the output is
> 
> #!/usr/local/bin/ruby  
> print “Content-type: text/html\r\n\r\n”  
> print “Hello SAm and Lisa!!!\r\n”
> 
> That’s right, it’s just the same file. So my question is, what  
> directives to I need to add to my “httpd.conf” file to make this file  
> interpret? I am surprised by how little documentation there is on how  
> to do this.
> 
> Thanks, - Dave

Hi Dave,

Please take a look at: [http://wiki.modruby.net/en/?InstallGuide](http://wiki.modruby.net/en/?InstallGuide)  
It was the only straight installation manual that I found out there and  
it was a great help.

Note: pay attention on which version of Apache are you going to make the  
installation (Apache or Apache2).

Best regards,  
Alin.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [February 1, 2007, 12:05pm UTC](https://www.ruby-forum.com/t/cant-get-apache2-to-i-interpret-my-ruby-file/84080/4 "2007-02-01T12:05:03Z")

</div>

Daniel S. wrote:

> [http://httpd.apache.org/docs/1.3/howto/cgi.html](http://httpd.apache.org/docs/1.3/howto/cgi.html)

Better use this one:  
[http://httpd.apache.org/docs/2.0/howto/cgi.html](http://httpd.apache.org/docs/2.0/howto/cgi.html)

–  
Over by the window lie the raiment and the weapons  
That we need to take into this world today  
Armoured by opinion, with statistic and schoolboy’s charm  
We take our place amongst the rank and file

Skyclad - A Survival Campaign

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [February 1, 2007, 7:24am UTC](https://www.ruby-forum.com/t/cant-get-apache2-to-i-interpret-my-ruby-file/84080/5 "2007-02-01T07:24:47Z")

</div>

Alin P. wrote:

> removed\_email\_address@domain.invalid wrote:
> 
> > Hi,
> > 
> > I have Apache 2.2 installed on my Fedora Core 5 Linux machine. I  
> > created this file, “test.rb” at my public document root
> > 
> > #!/usr/local/bin/ruby  
> > print “Content-type: text/html\r\n\r\n”  
> > print “Hello everybody!!!\r\n”
> > 
> > and when i visit [http://mydomain.com/test.rb](http://mydomain.com/test.rb), the output is
> > 
> > #!/usr/local/bin/ruby  
> > print “Content-type: text/html\r\n\r\n”  
> > print “Hello SAm and Lisa!!!\r\n”
> > 
> > That’s right, it’s just the same file. So my question is, what  
> > directives to I need to add to my “httpd.conf” file to make this file  
> > interpret? I am surprised by how little documentation there is on how  
> > to do this.
> > 
> > Thanks, - Dave
> 
> Hi Dave,
> 
> Please take a look at: [http://wiki.modruby.net/en/?InstallGuide](http://wiki.modruby.net/en/?InstallGuide)  
> It was the only straight installation manual that I found out there and  
> it was a great help.
> 
> Note: pay attention on which version of Apache are you going to make the  
> installation (Apache or Apache2).
> 
> Best regards,  
> Alin.

Sorry, I forgot one more thing:  
The installation above is about linux (or this is where it helped me)  
For win32 install, check that: [http://www.hiveminds.co.uk/node/3094](http://www.hiveminds.co.uk/node/3094)

Alin.
