Hi.
I’m new to Ruby, and struggling; Ruby does not seem to be very easy to
install under Linux.
it should be - should be an easy fix.
I can’t use the Suse RPM package, as I want the functionality of FOX and
fxruby, and they aren’t on the distro. So I installed Ruby, FOX, and fxruby
from the source tars. After several problems with the install process
(libraries didn’t seem to go where Ruby assumes them to be), by adding links
and setting environment variables I have managed to get these working; I can
run trivial programs, and I get the GUI results expected.
you have two good choices
a) install ruby where your system looks for stuff
b) configure your system to look where ruby puts stuff
you should not need links or environment vars in either case. do a man
‘ld.so’ to grok what i’m talking about, but you might try this:
-
export LD_RUN_PATH=/usr/local/lib/
-
install fox, fxruby, and ruby in this location, for example:
./configure --prefix=/usr/local
make
sudo make install
(note that /usr/local is probably the default for each of these)
this is assuming each of those packages installs with the standard
configure/make/make install business…
this would setup all the bins/libs for these packages to KNOW themselves where
to look for things - as having LD_RUN_PATH set at complie time encodes it
in the binaries. this obviates the need to use envs or links.
The problems just start afresh when I try to add extension libraries, or
even run programs that need libraries that I think I have already installed.
For example, there are a couple of sample programs that require soap and
html parser functionality - I thought soap was part of the core, but I
installed it again in any case, and also installed the html parser stuff.
The installs run clean but the programs still give load errors.
run this
~ > which ruby
~ > which -a ruby
you probably have the following situation
- /usr/bin/ruby (1.6.8)
- /usr/local/bin/rbuy (1.8.1)
each of them looks for libs in a different place (based on version), you have
probably installed things with one ruby, but are running with another.
export PATH=/usr/local/bin:$PATH
and try again
in general, if you are having load errors do this
ruby -e ‘p $LOAD_PATH’
this tells you where ruby looks for things - then check if they are there. if
they aren’t then they have not been installed correctly or you are using a
different ruby which looks different places
I suspect the problem is where the library modules and files are expected to
be - I just can’t sort it out; I’ve copied everything several times over in
every place I think they should be; I have multiple copies all the same in
…/ruby/1.8, …/ruby/site-ruby/1.8, in my home directory …/ruby/1.8
and …/ruby/site-ruby/1.8.
but if you are running /usr/bin/ruby and it’s 1.6.8 it won’t look any of those
places…
I’ve looked through various websites and documentation, and though there
seems a lot of it, it’s not very well organised and after three days
struggling I can’t find what I’m looking for; my questions are:
Where does ruby expect library and extension files to be? What are the
rules? Is there a single document that tells me how to sort this mess out?
Can anyone point me? Ruby seems to be so close to what I want but if it’s
going to be like this all the time
stick with it. this really doen’t have anything to do with ruby and every
thing to do with unix - understand the concepts of PATH, LD_RUN_PATH, and
LD_LIBRARY_PATH and you will be set for more that just ruby. if you have more
problems post some more.
welcome to the club.
-a
···
On Thu, 29 Apr 2004, Mike Calder wrote:
===============================================================================
EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov
PHONE :: 303.497.6469
ADDRESS :: E/GC2 325 Broadway, Boulder, CO 80305-3328
URL :: Solar-Terrestrial Physics Data | NCEI
TRY :: for l in ruby perl;do $l -e “print "\x3a\x2d\x29\x0a"”;done
===============================================================================