Newbie installation problem: libraries?

I have recently installed ruby-1.8.1 on my Mandrake Linux system.

Everything seems to be working except any programs with “require”,
such as irb requiring “irb”.

I hope this is just a matter of ruby not finding its libraries, which
are actually here somewhere.

Do you know how I can correct this problem?

Thanks.

Paul Emmons wrote:

I have recently installed ruby-1.8.1 on my Mandrake Linux system.

That’s what I’ve got, and installing is always painless, at least when
starting from source. Did you install from the tarball or from a rpm?

Everything seems to be working except any programs with “require”,
such as irb requiring “irb”.

Is this your error message?

ruby: No such file to load – irb (LoadError)

You can do the following to see where ruby is looking for libs:

$ ruby -e ‘puts $LOAD_PATH’

Ruby searches a default list of directories. You can see
that list by entering this command:

ruby -e ‘puts $:.join(“\n”)’

On my Mandrake system the output looks like this:

/usr/local/lib/ruby/site_ruby/1.8
/usr/local/lib/ruby/site_ruby/1.8/i686-linux
/usr/local/lib/ruby/site_ruby
/usr/local/lib/ruby/1.8
/usr/local/lib/ruby/1.8/i686-linux

The exact list you see depends on how you installed Ruby. If you compiled
from source, it should look pretty much like mine. If you installed from
an .rpm, the prefix is probably ‘/usr’ instead of ‘/usr/local’ (assuming
you took the default).

Look in those directories to make sure everything looks okay. If not, try
to determine what went wrong during the install. Did you get any error
messages? How did you install? From source, or from an rpm?

···

On Tue, 18 May 2004 14:40:16 -0400, Paul Emmons wrote:

I have recently installed ruby-1.8.1 on my Mandrake Linux system.

Everything seems to be working except any programs with “require”, such as
irb requiring “irb”.

I hope this is just a matter of ruby not finding its libraries, which are
actually here somewhere.

Do you know how I can correct this problem?

Thanks.

Paul Emmons pemmons@voicenet.com wrote in message news:gtlka05f0js7diommkcujmuioiqa5srtuh@4ax.com

I have recently installed ruby-1.8.1 on my Mandrake Linux system.

Everything seems to be working except any programs with “require”,
such as irb requiring “irb”.

I hope this is just a matter of ruby not finding its libraries, which
are actually here somewhere.

Do you know how I can correct this problem?

Thanks.
People have already noted how you can find what path is
automatically used by ruby, e.g., by
ruby -e ‘puts $LOAD_PATH’

To change this, you can set the shell environment variable RUBYLIB.
For example, in my .bashrc on one of the computers I use, I have the
lines:
RUBYLIB=“$HOME/comp_lang/ruby/nucm:$HOME/comp_lang/ruby/pnom”
export RUBYLIB

This allows me to require files in ~/comp_lang/ruby/nucm and
~/comp_lang/ruby/pnom without explicitly giving the directory.
If I run a script in my home directory with the line:
require ‘nucm_utils’

This loads the file ~/comp_lang/ruby/nucm/nucm_utils.rb into ruby.

Regards, Bret

Yes, that’s what I see; but most of these directories are empty.
/usr/local/lib/ruby/site_ruby/1.8/i686-linux has:
config.h rbconfig.rb

and that’s all.

I installed from a tarball. Is an RPM easier?

When I first ran CONFIGURE, it exited and closed out my whole
terminal. Perhaps I misunderstood the “run ./configure” in the
README. It’s executable, so I should have typed “configure” rather
than “. configure”.

Then I discovered from the log file that a file or two needed to be in
a different directory than it was in. I’m afraid I can’t recall what
these files were or where I had to copy them.

I could start all over if I were sure how to uninstall first. Would
that be make realclean?

Thank you for replying, and so quickly!

···

On Tue, 18 May 2004 18:45:27 GMT, Tim Hunter cyclists@nc.rr.com wrote:

ruby -e ‘puts $:.join(“\n”)’

On my Mandrake system the output looks like this:

/usr/local/lib/ruby/site_ruby/1.8
/usr/local/lib/ruby/site_ruby/1.8/i686-linux
/usr/local/lib/ruby/site_ruby
/usr/local/lib/ruby/1.8
/usr/local/lib/ruby/1.8/i686-linux

Paul Emmons wrote:

When I first ran CONFIGURE, it exited and closed out my whole
terminal. Perhaps I misunderstood the “run ./configure” in the
README. It’s executable, so I should have typed “configure” rather
than “. configure”.

I would unpack the tarball again and then try this:

./configure
make
su
make install

Sometimes, but since you already have the tarball let’s stick with that.
Echoing Joel’s advice:

  1. unpack the tarball
  2. cd into the top directory
  3. ./configure
  4. make
  5. su
  6. make install

Everything should be copacetic.

P.S. I’m assuming that you took all the defaults before.

···

On Tue, 18 May 2004 17:02:49 -0400, Paul Emmons wrote:

I installed from a tarball. Is an RPM easier?

During make install, I got:
…/instruby.rb:138: private method sub!' called for nil:NilClass (NoMethodError) from ./instruby.rb:134:in open’
from ./instruby.fb:134
from ./instruby.rb:121:in `each’
from ./instruby.rb:121
make: *** [install] Error 1

···

On Wed, 19 May 2004 06:05:49 +0900, Joel VanderWerf vjoel@PATH.Berkeley.EDU wrote:

Paul Emmons wrote:

When I first ran CONFIGURE, it exited and closed out my whole
terminal. Perhaps I misunderstood the “run ./configure” in the
README. It’s executable, so I should have typed “configure” rather
than “. configure”.

I would unpack the tarball again and then try this:

/configure
make
su
make install

It worked this time!
I unpacked the tarball into a totally new place. When I unpacked it
into the directories it had already been unpacked in before, it didn’t
work.

Thank you!

How long should all these unpacked files and subdirectories stay? Is
is o.k. to delete them and just keep the tarball (and maybe some log
files?)

···

On Wed, 19 May 2004 06:05:49 +0900, Joel VanderWerf vjoel@PATH.Berkeley.EDU wrote:

I would unpack the tarball again and then try this:

/configure
make
su
make install

It’s okay to delete them now. You can always get the tarball again from
the same place you got it from this time.

P.S.
If you want to read the source code to the Ruby translator, then you
should keep the unpacked source files.

···

On Sat, 22 May 2004 17:32:13 -0400, Paul Emmons wrote:

How long should all these unpacked files and subdirectories stay? Is is
o.k. to delete them and just keep the tarball (and maybe some log files?)

Oh, I always keep the tarballs-- if not on the hard disk, then on some
backup medium. I’m a pack rat :slight_smile:

But thank you! I gather that the procedure people have described for
installing Ruby is pretty standard for tarballs, right (I’m pretty new
at this).

···

On Sat, 22 May 2004 22:03:00 GMT, Tim Hunter cyclists@nc.rr.com wrote:

It’s okay to delete them now. You can always get the tarball again from
the same place you got it from this time.

P.S.
If you want to read the source code to the Ruby translator, then you
should keep the unpacked source files.