[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: CGI with Ruby

jmg3000

7/11/2006 8:11:00 PM

On 7/11/06, Harish TM <harish.tmh@gmail.com> wrote:
> Hi,
> I am having some problems with Ruby CGI code. What I am trying to do
> is to use the Ruby WordNet Modules when working with some CGI programs. I
> need the CGI program to call a couple of functions defined in a different
> module. The CGI program seems to run fine when run from the command line
> (offline mode) but when run from a browser it does not load the WordNet
> modules.
>
> Could someone please help out with this.

What does your apache error log say?

1 Answer

jmg3000

7/12/2006 2:13:00 AM

0

On 7/11/06, Harish TM <harish.tmh@gmail.com> wrote:
> Just to add on
>
> was looking through the wordnet files (the ones that got installed) and
> here is a part
>
> file wordnet.rb:
>
> # This file contains functions for finding relations for English words. It
> # requires the Ruby-WordNet module to be installed; if it is not installed,
> # calling the functions defined by this file will raise NotImplemented
> # exceptions if called. Requiring this file adds functions and constants to
> the
> # Linguistics::EN module.
>
>
> module Linguistics
> module EN
>
> @hasWordnet = false
> @wnError = nil
> @wnLexicon = nil
>
> # Load WordNet and open the lexicon if possible, saving the error
> that
> # occurs if anything goes wrong.
> begin
> ( ERROR GENERATED HERE)
> require 'wordnet'
> @hasWordnet = true
> rescue LoadError => err
> @wnError = err
> end
>
> why is it that wordnet.rb is including wordnet? its the same file right?

`require` looks for a filename, so, yeah, that may be the same file.
Maybe you've got more than one wordnet.rb file in the different
directories that Ruby's `require` goes looking for files in?

Sorry I can't help more. Maybe someone here can outline some of the
tricks they use for debugging CGI scripts...