Hello iahve just installed Ruby grom sources. Here i a command I have executed:
$ruby -v
ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-linux]
Unfortunately I am not able to start up the irb:
$irb -v
/usr/bin/irb:10:in `require': no such file to load -- irb (LoadError)
from /usr/bin/irb:10
Yhe irb. rb is available undet the following directory:
$find / -name irb.rb
/lib/ruby/1.8/irb.rb
What should I to addjust? How the ruby searches when looking for libraris i.e. irb.rb or socket.rb? How to fix the problem?
Regards,
FO
Alle mercoledì 19 settembre 2007, Fibre Optic ha scritto:
Hello iahve just installed Ruby grom sources. Here i a command I have
executed:
$ruby -v
ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-linux]
Unfortunately I am not able to start up the irb:
$irb -v
/usr/bin/irb:10:in `require': no such file to load -- irb (LoadError)
from /usr/bin/irb:10
Yhe irb. rb is available undet the following directory:
$find / -name irb.rb
/lib/ruby/1.8/irb.rb
What should I to addjust? How the ruby searches when looking for
libraris i.e. irb.rb or socket.rb? How to fix the problem?
Regards,
FO
You can see the ruby load path with the following command:
ruby -e 'puts $:'
The ruby load path (which can be accessed from ruby using the $: variable) is
made by some hard coded directories, depending on the installation path
passed to the configure script, by the contents of the RUBYLIB environment
variable and by directories passed to ruby via the -I command line option.
From what you posted, it seems that the ruby executable (at least, the irb
executable) is installed with a different prefix than the ruby libraries (the
former in /usr, the latter in /). This is a setup I've never tried, but I
think can be obtained passing options like --bindir and the like to
configure. If you didn't use such options, I'd suggest you to reinstall ruby
passing only the --prefix=/usr option to the configure script. This should
leave you with the following setup:
/usr/bin/
ruby
irb
erb
rdoc
...
/usr/lib/ruby/1.8/
abbrev.rb
benchmark.rb
irb.rb
irb
bigdecimal
...
If you truly meant to install the libraries there, I can't help you much (as I
said, I've no experience with that setup). You can try adding /lib/ruby/1.8
to the RUBYLIB environment variable or passing the -I/lib/ruby/1.8 option to
irb.
I hope this helps
Stefano
Stefano Crocco wrote:
You can see the ruby load path with the following command:
ruby -e 'puts $:'
The ruby load path (which can be accessed from ruby using the $: variable) is made by some hard coded directories, depending on the installation path passed to the configure script, by the contents of the RUBYLIB environment variable and by directories passed to ruby via the -I command line option.
From what you posted, it seems that the ruby executable (at least, the irb executable) is installed with a different prefix than the ruby libraries (the former in /usr, the latter in /). This is a setup I've never tried, but I think can be obtained passing options like --bindir and the like to configure. If you didn't use such options, I'd suggest you to reinstall ruby passing only the --prefix=/usr option to the configure script. This should leave you with the following setup:
/usr/bin/
ruby
irb
erb
rdoc
...
/usr/lib/ruby/1.8/
abbrev.rb
benchmark.rb
irb.rb
irb
bigdecimal
...
If you truly meant to install the libraries there, I can't help you much (as I said, I've no experience with that setup). You can try adding /lib/ruby/1.8 to the RUBYLIB environment variable or passing the -I/lib/ruby/1.8 option to irb.
Hi,
it was nice hint... at first attempt I tried to configure ruby on this way:
./configure \
--target=$(GNU_TARGET_NAME) \
--host=$(GNU_TARGET_NAME) \
--build=$(GNU_HOST_NAME) \
$(DISABLE_NLS) \
$(DISABLE_LARGEFILE) \
--prefix=/usr \
--exec-prefix=/usr \
--bindir=/usr/bin \
--sbindir=/usr/sbin \
--libdir=/lib \
--libexecdir=/usr/lib \
--sysconfdir=/etc \
--datadir=/usr/share \
--localstatedir=/var \
--mandir=/usr/man \
--infodir=/usr/info \
Unfortunately it did no work... after I received your answer I tried this:
./configure \
--target=$(GNU_TARGET_NAME) \
--host=$(GNU_TARGET_NAME) \
--build=$(GNU_HOST_NAME) \
$(DISABLE_NLS) \
$(DISABLE_LARGEFILE) \
--prefix=/usr \
and it works good!
Regards,
FO