Re: Examples
John Kloian III <[email protected]> Mon, 11 Oct 2004 06:58:02 -0700 (MST)
| Newsgroups | gmane.comp.apache.mod-ruby |
|---|---|
| Message-ID | <Pine.LNX.4.58.0410110657120.29243@gandalf> |
Somewhere in your code do you assign req to Apache.request? There error suggests that you did not. John Kloian III Vice President of IT DataBill, LLC. On Mon, 11 Oct 2004, Nick Willson wrote: > Please help me find working examples of using mod_ruby and its classes. > > I attempted to use the following example from > http://modruby.net/en/doc/?cmd=view&p=Apache%3A%3ARequest&key=example > > include Apache > > # Make sure that ExecCGI and Indexes are turned on for the Location > # being served: > unless req.allow_options & (OPT_EXECCGI|OPT_INDEXES) > req.log_reason( "ExecCGI and/or Indexes are off in this directory", > req.filename ) > return FORBIDDEN > end > > which produces the following in the apache error.log > > [Mon Oct 11 00:38:54 2004] [error] mod_ruby: error in ruby > [Mon Oct 11 00:38:54 2004] [error] mod_ruby: /var/www/ruby/test.rb:5: > undefined local variable or method `req' for main:Object (NameError) > [Mon Oct 11 00:38:54 2004] [error] mod_ruby: from > /usr/lib/ruby/1.8/apache/ruby-run.rb:53:in `load' > [Mon Oct 11 00:38:54 2004] [error] mod_ruby: from > /usr/lib/ruby/1.8/apache/ruby-run.rb:53:in `handler' > > -- > Nick > > >