I’m searching for something equivilent to Perl’s “use lib”.
I can see that there is a -I parameter to ruby itself, but
that seems clumsy when there are many paths to be added to
the include path (is that what ruby even calls it?).
I’m searching for something equivilent to Perl’s “use lib”. I can see that
there is a -I parameter to ruby itself, but that seems clumsy when there are
many paths to be added to the include path (is that what ruby even calls
it?).
It’s called the load path, and it’s stored in the global $: variable,
which is an array to which you can add:
$:.push("/whatever")
If you don’t like $: you can also address it as $LOAD_PATH.