I tried the suggestion of installing from source and I like the result
better. (My suggestion to run rdoc --ri is only useful if you run it
in some directory whose tree contains the source code (*.c) files for
Ruby. ) After an install from source with
../configure
make
su
make install
great.
The ri and irb commands work fine. But when I try to use FxRuby, the
extension for the Fox Gui Toolkit, there are problems. The extension
wants the library libruby.so, which is missing. I tried
make distclean
../configure --enable-shared --enable-install-doc --enable-pthread
(As if I really knew what I was doing !)
make
make install-all
Then I had a libruby.so and ruby, irb and ri still worked.
However the elementary test
> require 'fox14'
fails since it cannot find the files fox14/core.rb and fox14/core.so.
An strace of this process shows it is looking in the correct path for
the files. (I resorted to running irb in the fox14 directory.) The
problem is that the files were not produced when I compiled fox-1.4.32.
here is what i think happened (largely guessing):
- you compiled ruby using defaults. this installed into --prefix=/usr/local
see if this is true. if so see what happens why you type
/usr/local/bin/irb
does it work? if so great. note that you still probably have another
ruby and irb in /usr/bin!
- now, rhe is evil and does not look in /usr/local/lib for linking. the way
to handle this is to configure the linker properly. do a 'man ldconfig'
or 'man ld.so' - basically you have to add a line with '/usr/local/lib' to
'/etc/ld.so.conf' and run 'ldconfig'. this just tells the system to look
here for libs. the reason you want to do this is because your libruby.so
is probably in /usr/local/lib/libruby.so now. (is it?)
- here is a totally general way to compile stuff, including stuff that has
mutual dependancies
export prefix=/usr/local/
export LD_LIBRARY_PATH=$prefix/lib
export LD_RUN_PATH=$prefix/lib
export PATH=$prefix/lib
./configure --prefix=$prefix && make && sudo make install
(note: never, never, never compile as root)
if you build ruby this was and then fox all should be well. ping me
offline if you stil have issues. you can probably recover what you have
by setting the right ENV vars - but it may be easier to start over with
ruby first... maybe not.
if you have issues ping me offline so we don't bore everyone...
I'll be delighted if someone can tell me the answer to that problem.
However to return to generalities: I think people trying to use Ruby
face more of a challenge than Perl and Python users since they are less
likely to find Ruby installed and ready-to-go. In the current epoch,
writers of tutorials would do better to give detailed coverage of
installation problems. Otherwise the pages about how easy and nice
Ruby is will seem a fraud.
For example, if you read the typical exposition of the
require 'xyz'
"command, it doesn't explain how the name 'xyz' is connected to any
file on the machine. By experiment it seems to search for a directory
named 'xyz'. What paths does it take? What files does it need in that
directory? If everything is perfectly installed you don't have to
worry about this, but in practice you do.
true statements all.
like i said before though - the best (but painful) - answer (imho) is to learn
about the compilers and linkers on your system. as lame as this sounds one
can take solace in the fact that it's like learning 'vi' - once you know it
you're set on __any__ *nix system - including macs.
btw. are you a sysad? we sure can't get root on ANY of our systems now
unless one is a sysad...
kind regards.
-a
···
On Fri, 31 Mar 2006 stephen.tashiro@us.army.mil wrote:
--
share your knowledge. it's a way to achieve immortality.
- h.h. the 14th dali lama