From: Phillip Neiswanger Date: 2006-12-06T16:36:16+09:00 Subject: Re: Apache and Ruby On Tue, 05 Dec 2006 23:43:32 -0700, Justin Collins wrote: > Phillip Neiswanger wrote: >> Hi, >> >> New to ruby and apache. Been trying to get a simple ruby script to run >> via apache. The script is as follows: >> >> #!/usr/bin/env ruby >> require "cgi" >> cgi = CGI.new("html3") >> cgi.out("text/plain"){ >> "Hello World" >> } >> >> I attempt to access it with my browser via an address like: >> http://127.0.0.1/script.rb. Apache is clearly not running ruby since I >> get the script back verbatim to the browser. Plain html, ie no ruby, >> is working. So far, in my search for an answer I haven't found >> anything to alleviate my problems. Interestingly, I have eRuby >> working, ie I can embed ruby code in my html, but not ruby. What >> special Apache incantation do I need to get it working? I'm running >> Opera/FireFox, Apache 2.2.3 and Ruby 1.8.5 on FreeBSD 6.1 system. I am >> not interested in getting rails working right now, just ruby. >> >> Any help would be appreciated. >> -- phil > > Do you have mod_ruby installed? > > -Justin Thanks for the reply Justin. I fixed my problems with the following lines in httpd.conf Options ExecCGI AddHandler cgi-script .rb I also had to make sure the .rb files had the appropriate group ownership. -- phil