Re: Can't Get mod_ruby to Work in Apache 2.0.47

Cameron McBride <[email protected]>
Newsgroups gmane.comp.apache.mod-ruby
Message-ID <20040305135855.GA11560@localhost>
Mark,

> I dabble a bit in vbscript and ASP and have wanted to switch to something
> using Apache & Linux. I saw some people mentioning Ruby and read about it
> and mod_ruby and thought I would give it a try. 

very nice!

> require 'cgi'
> cgi = CGI.new
> print cgi.header['type'=>'text/html']


try changing the last line to:
  print cgi.header('type'=>'text/html')

> -----
> 
> On Apache 2.0.47, mod_ruby doesn't work with my /ruby/rubytest.rbx file...
> it just loads like a regular text file.

<snipped>

> 
> <IfModule mod_ruby.c>
>     RubyRequire apache/ruby-run
>     <Location /ruby/*.rbx>
>     	SetHandler ruby-object
>     	RubyHandler Apache::RubyRun.instance
>       #Options ExecCGI 	#This directive already used above.
>     </Location>
>     
>     RubyRequire apache/eruby-run
>     <Location /*.rhtml>
>     	SetHandler ruby-object
>       RubyHandler Apache::ERubyRun.instance
>     </Location>
> </IfModule>

I'm not sure <Location> likes filename extensions, but I could be wrong.
Try changing this config to use the <Files> directive.

More info: 
  http://httpd.apache.org/docs-2.0/sections.html
  http://httpd.apache.org/docs-2.0/mod/core.html#files

e.g.  (from mod_ruby/examples)
  <Files *.rbx>
    SetHandler ruby-object
    RubyHandler Apache::RubyRun.instance
  </Files>


Hope that helps.

Cameron
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.