why i can't find my ruby ?

P

Pen Ttt

i installed ruby this way:
sudo wget ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p0.tar.bz2
sudo tar jxvf ruby-1.9.2-p0.tar.bz2
cd /home/pt/ruby-1.9.2-p0
sudo ./configure -prefix=/usr/local/ruby
sudo make && make install
sudo ln -s /usr/local/ruby/bin/ruby /usr/bin/ruby
sudo ln -s /usr/local/ruby/bin/gem /usr/bin/gem
sudo gedit /etc/environment

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/ruby/bin"
when i restart,
pt@pt:~$ ruby -v
The program 'ruby' is currently not installed. You can install it by
typing:
sudo apt-get install ruby

could you mind to tell me how to resolve it?
 
D

David Unric

Pen Ttt wrote in post #962916:
i installed ruby this way:
sudo wget ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p0.tar.bz2
sudo tar jxvf ruby-1.9.2-p0.tar.bz2
cd /home/pt/ruby-1.9.2-p0
sudo ./configure -prefix=/usr/local/ruby
sudo make && make install
sudo ln -s /usr/local/ruby/bin/ruby /usr/bin/ruby
sudo ln -s /usr/local/ruby/bin/gem /usr/bin/gem
sudo gedit /etc/environment

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/ruby/bin"
when i restart,
pt@pt:~$ ruby -v
The program 'ruby' is currently not installed. You can install it by
typing:
sudo apt-get install ruby

could you mind to tell me how to resolve it?

First you have to check whether the compilation & installation process
did succeeded.
Second the target prefix for configure script has two hyphens before so
it has to look like:
sudo ./configure --prefix=/usr/local/ruby
Third what is an output of <code>ls -l /usr/local/ruby/bin/ruby</code> ?
 
R

Rick DeNatale

i installed ruby this way:
sudo wget ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p0.tar.bz2
sudo tar jxvf ruby-1.9.2-p0.tar.bz2
cd /home/pt/ruby-1.9.2-p0
sudo ./configure -prefix=3D/usr/local/ruby
sudo make && make install

First off you seem to be using sudo when it normally isn't used and
not with it is.

Normally do all of the steps up to and including make as a normal user
and then do

sudo make install

and only if you are installing to a place which requires root
privileges. Using sudo unnecessarily is dangerous since you really
don't know what those commands might do particularly the make

sudo ln -s /usr/local/ruby/bin/ruby /usr/bin/ruby
sudo ln -s /usr/local/ruby/bin/gem /usr/bin/gem

This is wrong, you are making /usr/local/ruby/bin/ruby point to the
system installed ruby and the same thing for the gem executable. I'm
not sure why you did this. If the make install worked it should have
made ruby and gem accessible via /usr/loca/bin, probably via symlinks.
And since you are setting the PATH environment variable to put
/usr/local/bin ahead of /usr/bin the shell should find your installed
ruby.

I suspect that what happened is that the make install failed because
you didn't run it under sudo.


That all said, if it were me I'd install ruby using RVM
sudo gedit /etc/environment

PATH=3D"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr= /games:/usr/local/ruby/bin"
when i restart,
pt@pt:~$ ruby -v
The program 'ruby' is currently not installed. You can install it by
typing:
sudo apt-get install ruby

could you mind to tell me how to =A0resolve it?



--=20
Rick DeNatale

Blog: http://talklikeaduck.denhaven2.com/
Github: http://github.com/rubyredrick
Twitter: @RickDeNatale
WWR: http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn: http://www.linkedin.com/in/rickdenatale
 
B

Brian Candler

Rick Denatale wrote in post #962943:
This is wrong, you are making /usr/local/ruby/bin/ruby point to the
system installed ruby and the same thing for the gem executable.

That's untrue. ln -s is
ln -s <link-target> <where-to-install-the-link>

And in any case, the OP didn't have a system ruby anyway.

I would start with typing

/usr/local/ruby/bin/ruby -v

Does that work? If so, you want /usr/local/ruby/bin on your $PATH

If not, look at the configure and make output to see what went wrong.
That all said, if it were me I'd install ruby using RVM

Yes, that takes care of all this stuff and more.
 
P

Pen Ttt

thinks everyone.this right way is :
sudo wget ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p0.tar.bz2
sudo tar jxvf ruby-1.9.2-p0.tar.bz2
cd /home/pt/ruby-1.9.2-p0
sudo ./configure --prefix=/usr/local/ruby
sudo make
sudo make install
sudo ln -s /usr/local/ruby/bin/ruby /usr/bin/ruby
sudo ln -s /usr/local/ruby/bin/gem /usr/bin/gem
sudo gedit /etc/environment

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/ruby/bin"
 
R

Ryan Davis

thinks everyone.this right way is :
sudo wget ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p0.tar.bz2
sudo tar jxvf ruby-1.9.2-p0.tar.bz2
cd /home/pt/ruby-1.9.2-p0
sudo ./configure --prefix=3D/usr/local/ruby
sudo make
sudo make install
sudo ln -s /usr/local/ruby/bin/ruby /usr/bin/ruby
sudo ln -s /usr/local/ruby/bin/gem /usr/bin/gem
sudo gedit /etc/environment
=20
=
PATH=3D"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/=
games:/usr/local/ruby/bin"

Again, don't blindly use sudo!

This should work just as well, and safer too:

cd
wget ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p0.tar.bz2
tar jxvf ruby-1.9.2-p0.tar.bz2
cd ruby-1.9.2-p0
/configure --prefix=3D/usr/local/ruby && make && sudo make install
sudo ln -s /usr/local/ruby/bin/ruby /usr/bin/ruby
sudo ln -s /usr/local/ruby/bin/gem /usr/bin/gem

and since you're making symbolic links to a directory that is already in =
your PATH, you don't need to edit your PATH in /etc/environment.
 
P

Pen Ttt

when i installed ruby,
pt@pt:~$ ruby -v
ruby 1.9.2p0 (2010-08-18 revision 29036) [i686-linux]
pt@pt:~$ irb
The program 'irb' can be found in the following packages:
* ruby
* irb
Try: sudo apt-get install <selected package>
what's wrong?
 
P

Pen Ttt

"irb" +pressing TAB =EF=BC=8Cnothing happen
"irb" +pressing TAB + Space bar
pt@pt:~$ irb
bash_history .local/
bash_logout .mozilla/
bashrc Music/
cache/ .nautilus/
compiz/ photo.tar.gz
config/ Pictures/
dbus/ .pki/
Desktop/ .profile
dmrc Public/
Documents/ .pulse/
Downloads/ .pulse-cookie
emacs.d/ .recently-used.xbel
esd_auth ruby-1.9.2-p0/
examples.desktop ruby-1.9.2-p0.tar.bz2
fontconfig/ .shotwell/
gconf/ .sudo_as_admin_successful
gconfd/ Templates/
gksu.lock .thumbnails/
gnome2/ vb
gnome2_private/ Videos/
gstreamer-0.10/ .VirtualBox/
gtk-bookmarks .xinput.d/
gvfs/ .xsession-errors

-- =

Posted via http://www.ruby-forum.com/.=
 
L

Lucas Nussbaum

when i installed ruby,
pt@pt:~$ ruby -v
ruby 1.9.2p0 (2010-08-18 revision 29036) [i686-linux]
pt@pt:~$ irb
The program 'irb' can be found in the following packages:
* ruby
* irb
Try: sudo apt-get install <selected package>
what's wrong?

How did you install ruby?

- Lucas
 
P

Pen Ttt

wget ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p0.tar.bz2
tar jxvf ruby-1.9.2-p0.tar.bz2
cd ruby-1.9.2-p0
sudo ./configure --prefix=/usr/local/ruby
sudo make
sudo make install
 
B

botp

when i installed ruby,
pt@pt:~$ ruby -v
ruby 1.9.2p0 (2010-08-18 revision 29036) [i686-linux]
pt@pt:~$ irb
The program 'irb' can be found in the following packages:
=A0* ruby
=A0* irb
Try: sudo apt-get install <selected package>
what's wrong?

you only created a link for ruby & gem.
you need to create a link for irb too.

best regards -botp
 
P

Peter Vandenabeele

You may try these 3 commands and report the result:

$ which ruby
$ ls -l `which ruby`
$ ls -l `which ruby | sed -e 's/ruby//'` | grep irb

In my case, the result is:

$ which ruby
/usr/bin/ruby
$ ls -l `which ruby`
lrwxrwxrwx 1 root root 43 2010-05-10 14:47 /usr/bin/ruby ->
/opt/ruby-enterprise-1.8.7-2010.01/bin/ruby
$ ls -l `which ruby | sed -e 's/ruby//'` | grep irb
lrwxrwxrwx 1 root root 42 2010-05-10 14:48 irb ->
/opt/ruby-enterprise-1.8.7-2010.01/bin/irb
-rwxr-xr-x 1 root root 376 2010-03-19 18:45 irb1.8
lrwxrwxrwx 1 root root 6 2010-03-31 17:00 irb-ORIG -> irb1.8


What it does is:

* use 'which' to find where you have ruby installed
* list the details about ruby (e.g. a symlink)
* search that same directory for the 'irb' command

That may give a hint where your ruby and irb are installed.

HTH,

Peter

"irb" +pressing TAB =C2=A0 =EF=BC=8Cnothing happen
=C2=A0"irb" +pressing TAB =C2=A0+ Space bar
pt@pt:~$ irb
.bash_history =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0.local/
.bash_logout =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 .mozilla/
.bashrc =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0Music/
.cache/ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0.nautilus/
.compiz/ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 p= hoto.tar.gz
.config/ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 P= ictures/
.dbus/ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 .pki/
Desktop/ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 .= profile
.dmrc =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0Public/
Documents/ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 .pulse= /
Downloads/ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 .pulse= -cookie
.emacs.d/ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0.= recently-used.xbel
.esd_auth =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0r= uby-1.9.2-p0/
examples.desktop =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ruby-1.9.2-p0.tar.bz2
.fontconfig/ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 .shotwell/
.gconf/ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0.sudo_as_admin_successful
.gconfd/ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 T= emplates/
.gksu.lock =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 .thumb= nails/
.gnome2/ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 v= b
.gnome2_private/ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Videos/
.gstreamer-0.10/ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 .VirtualBox/
.gtk-bookmarks =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 .xinput.d/
.gvfs/ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 .xsession-errors



--=20
Peter Vandenabeele
gsm: +32-478-27.40.69
e-mail: (e-mail address removed)
http://twitter.com/peter_v
 
P

Pen Ttt

pt@pt:~$ which ruby
/usr/bin/ruby
pt@pt:~$ ls -l `which ruby`
lrwxrwxrwx 1 root root 24 2010-11-29 16:00 /usr/bin/ruby ->
/usr/local/ruby/bin/ruby
pt@pt:~$ ls -l `which ruby | sed -e 's/ruby//'` | grep irb
pt@pt:~$

there is nothing for the last command
ls -l `which ruby | sed -e 's/ruby//'` | grep irb
 
P

Peter Vandenabeele

pt@pt:~$ which =C2=A0ruby
/usr/bin/ruby
pt@pt:~$ ls -l =C2=A0 `which ruby`
lrwxrwxrwx 1 root root 24 2010-11-29 16:00 /usr/bin/ruby ->
/usr/local/ruby/bin/ruby
pt@pt:~$ ls -l `which ruby | sed -e 's/ruby//'` | grep irb
pt@pt:~$

there is nothing =C2=A0for the last command
ls -l `which ruby | sed -e 's/ruby//'` | grep irb

(caveat, not actually tried, from memory).

So now try:

$ cd /usr/bin
$ sudo ln -s /usr/local/ruby/bin/irb irb

After that, the command:

$ ls -l `which ruby | sed -e 's/ruby//'` | grep irb

should show the symlink as on my computer.

and

$ which irb

should work.

You could also add to your .bashrc a line like:

PATH=3D/usr/local/ruby/bin:"${PATH}"

this wlll make all those command in /usr/local/ruby/bin available

HTH,

Peter
 
L

Lucas Nussbaum

wget ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p0.tar.bz2
tar jxvf ruby-1.9.2-p0.tar.bz2
cd ruby-1.9.2-p0
sudo ./configure --prefix=/usr/local/ruby
sudo make
sudo make install

Then ruby isn't in your $PATH.

Have you tried your distribution's packages?

- Lucas
 
P

Pen Ttt

$ cd /usr/bin
$ sudo ln -s /usr/local/ruby/bin/irb irb
PATH=3D"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr=
/games:/usr/local/ruby/bin=EF=BC=9A/usr/local/ruby/bin:"${PATH}""
it'ok,think everyone

-- =

Posted via http://www.ruby-forum.com/.=
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top