<andreas.cahen / gmail.com> schrieb im Newsbeitrag
news:1111168534.355181.69980 / g14g2000cwa.googlegroups.com...
>
> Robert Klemme wrote:
> >
> > You probably should set $LOAD_PATH explicitely in the script.  Try
> > ruby -e 'p $LOAD_PATH'
> > and see what it prints from the command line and from cron.
> >
>
> Shell: 375 Bytes
> Cron: 159 Bytes
>
> I get a huge difference between executing this command on the shell and
> as cronjob.. how comes?
>
> How do I set the $LOAD_PATH? I tried to set it inside my ruby script
> but I summoned an error..

$LOAD_PATH <<
  "/usr/lib/whatever" <<
  "/foo/bar"

You can as well do

$LOAD_PATH.clear <<
  "/usr/lib/whatever" <<
  "/foo/bar"

if you want to remove all initial content.  Or you use concat

$LOAD_PATH.clear.concat [
  "/usr/lib/whatever",
  "/foo/bar",
]

$: works as well (less typing but not as good from a documentation
perspective).  As you see there are zillions of ways to do it.  You can
even delete individual entries etc.  $LOAD_PATH is just a normal array.
:-)

Kind regards

    robert