Linux install of 1.8.2

M

Mark Volkmann

I've installed Ruby 1.8.2 from source under Fedora Core Linux. It
works, but when I run "ri String" I get "No such file to load --
rdoc/ri/ri_driver (LoadError). Also, when I run "irb" I get "No such
file to load -- irb (LoadError)". Is there something I have to do to
tell it that ruby-1.8.2/lib should be in the default LOAD_PATH?

When I run the following under my Windows installation I get lots of output=
 
T

ts

M> I've installed Ruby 1.8.2 from source under Fedora Core Linux. It
M> works, but when I run "ri String" I get "No such file to load --
M> rdoc/ri/ri_driver (LoadError). Also, when I run "irb" I get "No such
M> file to load -- irb (LoadError)". Is there something I have to do to
M> tell it that ruby-1.8.2/lib should be in the default LOAD_PATH?

To install the documentation, you must make

make install-doc

M> ruby -e "puts $LOAD_PATH"

use single quote, i.e.

svg% ruby -e "puts $LOAD_PATH"

svg%

svg% ruby -e 'puts $LOAD_PATH'
/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
 
H

Hugh Sasse

I've installed Ruby 1.8.2 from source under Fedora Core Linux. It

Which version of GCC does that ship with? Or are you using
something else for that matter?
works, but when I run "ri String" I get "No such file to load --

Which bits actually work, when you say "It works"? How was make
test when you did that before install?
rdoc/ri/ri_driver (LoadError). Also, when I run "irb" I get "No such
file to load -- irb (LoadError)". Is there something I have to do to
tell it that ruby-1.8.2/lib should be in the default LOAD_PATH?

When I run the following under my Windows installation I get lots of output.

ruby -e "puts $LOAD_PATH"

However, when I run that under my Linux installation I get no output
indicating that there is nothing in my default $LOAD_PATH.

What about
ruby -e "puts $LOAD_PATH.inspect"

Which would tell you the difference between nil and an empty string,
which may have some diagnostic value.Hugh
 
M

Mark Volkmann

M> I've installed Ruby 1.8.2 from source under Fedora Core Linux. It
M> works, but when I run "ri String" I get "No such file to load --
M> rdoc/ri/ri_driver (LoadError). Also, when I run "irb" I get "No such
M> file to load -- irb (LoadError)". Is there something I have to do to
M> tell it that ruby-1.8.2/lib should be in the default LOAD_PATH?

To install the documentation, you must make

make install-doc

M> ruby -e "puts $LOAD_PATH"

use single quote, i.e.

svg% ruby -e "puts $LOAD_PATH"

svg%

svg% ruby -e 'puts $LOAD_PATH'
/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
.

Ahh! Now I see the problem. Thanks!

It assumes that I installed Ruby in /usr/local. I don't have
permission to do that. I installed it under my home directory. How
can I tell it to look there instead?
 
T

ts

M> It assumes that I installed Ruby in /usr/local. I don't have
M> permission to do that. I installed it under my home directory. How
M> can I tell it to look there instead?

Change the PATH variable, something like (if it's in $HOME/local/bin)

export PATH=$HOME/local/bin:$PATH


Guy Decoux
 
M

Mark Volkmann

M> It assumes that I installed Ruby in /usr/local. I don't have
M> permission to do that. I installed it under my home directory. How
M> can I tell it to look there instead?

Change the PATH variable, something like (if it's in $HOME/local/bin)

export PATH=3D$HOME/local/bin:$PATH

I had already done that. The problem is that changing PATH doesn't
change what's in the default LOAD_PATH. When I run "ruby -e 'puts
$LOAD_PATH' " it outputs the same thing it did for you where all the
directories start with /usr/local/lib/ruby.
 
M

Mark Volkmann

Which version of GCC does that ship with? Or are you using
something else for that matter?

I'm using GCC and it is version 3.3.1.
Which bits actually work, when you say "It works"?

What I meant was that "ruby -v" responds with "ruby 1.8.2 (2004-12-25)
[i686-linux]".
How was make test when you did that before install?

It says "test succeeded".
What about
ruby -e "puts $LOAD_PATH.inspect"

Which would tell you the difference between nil and an empty string,
which may have some diagnostic value.

As Guy suggested, I just needed to use single quotes around the
command instead of double. The LOAD_PATH it outputs looks fine except
that all the directories start with /usr/local/lib/ruby.
 
T

ts

M> I had already done that. The problem is that changing PATH doesn't
M> change what's in the default LOAD_PATH. When I run "ruby -e 'puts
M> $LOAD_PATH' " it outputs the same thing it did for you where all the
M> directories start with /usr/local/lib/ruby.

Because it was not compiled with the right option, in ruby-1.8.3

make distclean
mkdir $HOME/local
./configure --prefix=$HOME/local
make
make install
make install-doc

--prefix is important


Guy Decoux
 
G

gga

Change or create a new variable called RUBYLIB that points to where
your ruby libraries are located.

On tcsh, use:
setenv RUBYHOME "$HOME/local/lib/ruby"
setenv PATH "$RUBYHOME/bin:$PATH"
setenv RUBYLIB "$RUBYHOME/lib:$RUBYHOME/lib/ruby/1.8"

Other shells use a slightly different syntax.

You will need to add all the following paths:
..../lib/ruby/site_ruby/1.8
..../lib/ruby/site_ruby/1.8/i386-msvcrt # where .so's are (varies)
..../lib/ruby/site_ruby/
..../lib/ruby/1.8
..../lib/ruby/1.8/i386-mswin32 # where .so's are (varies)
 
A

Ara.T.Howard

M> I had already done that. The problem is that changing PATH doesn't
M> change what's in the default LOAD_PATH. When I run "ruby -e 'puts
M> $LOAD_PATH' " it outputs the same thing it did for you where all the
M> directories start with /usr/local/lib/ruby.

Because it was not compiled with the right option, in ruby-1.8.3

make distclean
mkdir $HOME/local
./configure --prefix=$HOME/local
make
make install
make install-doc

--prefix is important

indeed. if you plan on compiling any extensions i would highly reccomend
doing

export prefix=$HOME/local
export LD_RUN_PATH=$HOME/local
export LD_LIBRARY_PATH=$HOME/local

make distclean
mkdir $prefix
./configure --prefix=$prefix
make
make install
make install-doc


doing the first three for every third party lib you intall will greatly ease
compiling and using extensions which themselves link to other libraries : like
the ruby postgres lib which, itself, uses the postgres client libs.

in fact, i wonder why mkmf would not set LD_RUN_PATH to $prefix or $libdir
when compiling? it would avert a lot of problems...

cheers.

-a
--
===============================================================================
| email :: ara [dot] t [dot] howard [at] noaa [dot] gov
| phone :: 303.497.6469
| Your life dwells amoung the causes of death
| Like a lamp standing in a strong breeze. --Nagarjuna
===============================================================================
 
M

Mark Volkmann

M> I had already done that. The problem is that changing PATH doesn't
M> change what's in the default LOAD_PATH. When I run "ruby -e 'puts
M> $LOAD_PATH' " it outputs the same thing it did for you where all the
M> directories start with /usr/local/lib/ruby.

Because it was not compiled with the right option, in ruby-1.8.3

make distclean>
mkdir $HOME/local
./configure --prefix=3D$HOME/local

Thanks! I didn't know about the --prefix option.
 

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,780
Messages
2,569,607
Members
45,240
Latest member
pashute

Latest Threads

Top