changing the environment for current process

T

Tammo Tjarks

I have the following situation:
I require an additional library, not part of the current search path.
I have done that simply by:
$:.push(<path>)
and that would work fine if I would not need shared libs. I tried
to simply set
ENV['LD_LIBRARY_PATH'] = ENV['LD_LIBRAY_PATH']+':'+<so-path>
but that seems not to work, the shared library is not found.
It only works when I make an
setenv LD_LIBRARY_PATH $LD_LIBRARY_PATH:<so-path>
before I start the script. Is there a way to modify the
environment for the current ruby process?
I would like to have the possibilites usually enabled by
module ( a tool where the environment can be altered with , where no ruby
support seems to exist).

Regards,
Tammo
 
G

Garry Offord

[Note: parts of this message were removed to make it a legal post.]

When I have wanted to make sure that the lib subdir of the directory from
which the program executes is added to the load path, I use this:

#
# make sure we can pull in anything under the directory where the program is
# being executed
#
$LOAD_PATH << File::join(File::dirname($0), "lib")

seems to work for me.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,019
Latest member
RoxannaSta

Latest Threads

Top