primehalo
11/6/2004 4:01:00 AM
David Ross <dross@code-exec.net> wrote in message news:<418AE839.9040401@code-exec.net>...
> Ara.T.Howard@noaa.gov wrote:
>
> > On Thu, 4 Nov 2004, Ken Innes wrote:
> >
> >> I inherited a project that uses Ruby 1.4.6 on a RedHat Linux 6.1J. I
> >> copied it onto my RedHat Linux 6.1J machine, but there is a problem
> >> when I try to build it; the ruby scripts are unable to find required
> >> files (located in the same directory as the scripts) when the script
> >> is executed from a different directory. I upgraded to Ruby 1.6.7,
> >> which fixed that problem, but the scripts are not quite compatible
> >> with the updated Ruby, so I had to revert to the version that was
> >> originally used.
> >>
> >> As an example, lets say I have two ruby scripts in a directory:
> >> /scripts/script1.rb:
> >> #!/usr/bin/ruby
> >> require "script2"
> >>
> >> /scripts/script2.rb:
> >> print "Testing...\n"
> >>
> >> Command Prompt:
> >> [testing]# cd /scripts
> >> [scripts]# script1.rb
> >> Testing...
> >> [scripts]# cd /testing
> >> [testing]# script1.rb
> >> script1.rb:2:in `require': No such file to load -- script2
> >> (LoadError)
> >>
> >> With Ruby 1.6.7, it works fine. With Ruby 1.4.6, it can find
> >> script1.rb, but not script2.rb.
> >>
> >> There must be a way to correct this, as the project apparently worked
> >> for the original developers. I'm using the same OS, and I added the
> >> same ruby options and script directory to my path as specified in
> >> their readme (well almost, they said put it in .cshrc, but I had to
> >> put it in .tcshrc for it to work):
> >> setenv RUBYOPT '-Ke -rkconv'
> >> set path = ( $path /scripts)
> >>
> >> I also tried the following:
> >> setenv RUBYOPT '-Ke -rkconv -S'
> >> setenv LOAD_PATH /scripts
> >> setenv RUBYLIB /scripts
> >>
> >> So what am I missing here? Does anyone know how I can get this to work
> >> correctly WITHOUT ALTERING THE SCRIPTS (because there are hundreds of
> >> scripts)?
> >
> >
> > i can't help you at all, but i'm dying to know: what project have you
> > inherited with hundreds of 1.4.6?
> >
> > -a
> > --
>
> heh, I'm suprised they kept that many scripts without adjusting to other
> releases. I'm curious myself as well. Insane it is =]
>
> David Ross
Can't go into details, but it's a project from Japan that was finished
years ago, probably when version 1.4.6 was current, or at least
near-current.