# Why i can't find my ruby?

**URL:** <https://rubytalk.org/t/why-i-cant-find-my-ruby/60913>\
**Category:** ruby-talk\
**Created:** [21 November 2010 12:43 UTC](https://rubytalk.org/t/why-i-cant-find-my-ruby/60913 "2010-11-21T12:43:59Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pen\_Ttt](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@Pen\_Ttt](https://rubytalk.org/u/Pen_Ttt)\
**Post date:** [21 November 2010 12:43 UTC](https://rubytalk.org/t/why-i-cant-find-my-ruby/60913/1 "2010-11-21T12:43:59Z")

</div>

i installed ruby this way:  
sudo wget [ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p0.tar.bz2](http://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?

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

**Author:** ![David\_Unric](https://avatars.discourse-cdn.com/v4/letter/d/90db22/32.png) [@David\_Unric](https://rubytalk.org/u/David_Unric)\
**Post date:** [21 November 2010 13:57 UTC](https://rubytalk.org/t/why-i-cant-find-my-ruby/60913/2 "2010-11-21T13:57:11Z")

</div>

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:  
&nbsp;&nbsp;sudo ./configure --prefix=/usr/local/ruby  
Third what is an output of \<code\>ls -l /usr/local/ruby/bin/ruby\</code\> ?

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).

---

<div class="post-metadata">

**Author:** ![Rick\_DeNatale1](https://avatars.discourse-cdn.com/v4/letter/r/bbce88/32.png) [@Rick\_DeNatale1](https://rubytalk.org/u/Rick_DeNatale1)\
**Post date:** [21 November 2010 14:37 UTC](https://rubytalk.org/t/why-i-cant-find-my-ruby/60913/3 "2010-11-21T14:37:10Z")

</div>

> 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

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

> **···**
>
> On Sun, Nov 21, 2010 at 7:43 AM, Pen Ttt \<myocean135@yahoo.cn\> wrote:
> 
> > 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?
> > 
> > --  
> > Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).
> 
> --  
> Rick DeNatale
> 
> Blog: [http://talklikeaduck.denhaven2.com/](http://talklikeaduck.denhaven2.com/)  
> Github: [rubyredrick (Rick DeNatale) · GitHub](http://github.com/rubyredrick)  
> Twitter: @RickDeNatale  
> WWR: [http://www.workingwithrails.com/person/9021-rick-denatale](http://www.workingwithrails.com/person/9021-rick-denatale)  
> LinkedIn: [http://www.linkedin.com/in/rickdenatale](http://www.linkedin.com/in/rickdenatale)

---

<div class="post-metadata">

**Author:** ![Pen\_Ttt](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@Pen\_Ttt](https://rubytalk.org/u/Pen_Ttt)\
**Post date:** [22 November 2010 01:42 UTC](https://rubytalk.org/t/why-i-cant-find-my-ruby/60913/4 "2010-11-22T01:42:12Z")

</div>

thinks everyone.this right way is :  
sudo wget [ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p0.tar.bz2](http://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"

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

**Author:** ![Pen\_Ttt](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@Pen\_Ttt](https://rubytalk.org/u/Pen_Ttt)\
**Post date:** [29 November 2010 12:04 UTC](https://rubytalk.org/t/why-i-cant-find-my-ruby/60913/5 "2010-11-29T12:04:11Z")

</div>

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?

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

**Author:** ![Pen\_Ttt](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@Pen\_Ttt](https://rubytalk.org/u/Pen_Ttt)\
**Post date:** [2 December 2010 09:35 UTC](https://rubytalk.org/t/why-i-cant-find-my-ruby/60913/6 "2010-12-02T09:35:33Z")

</div>

$ cd /usr/bin  
$ sudo ln -s /usr/local/ruby/bin/irb irb  
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/ruby/bin：/usr/local/ruby/bin:"${PATH}""  
it'ok,think everyone

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

**Author:** ![Brian\_Candler](https://avatars.discourse-cdn.com/v4/letter/b/5f9b8f/32.png) [@Brian\_Candler](https://rubytalk.org/u/Brian_Candler)\
**Post date:** [21 November 2010 21:01 UTC](https://rubytalk.org/t/why-i-cant-find-my-ruby/60913/7 "2010-11-21T21:01:42Z")

</div>

Rick Denatale wrote in post #962943:

> > 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.

That's untrue. ln -s is  
&nbsp;&nbsp;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

&nbsp;&nbsp;&nbsp;&nbsp;/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.

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).

---

<div class="post-metadata">

**Author:** ![Ryan\_Davis1](https://yyz1.discourse-cdn.com/flex029/user_avatar/rubytalk.org/ryan_davis1/32/1848_2.png) [@Ryan\_Davis1](https://rubytalk.org/u/Ryan_Davis1)\
**Post date:** [22 November 2010 02:55 UTC](https://rubytalk.org/t/why-i-cant-find-my-ruby/60913/8 "2010-11-22T02:55:16Z")

</div>

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=/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.

> **···**
>
> On Nov 21, 2010, at 17:42 , Pen Ttt wrote:
> 
> > 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"

---

<div class="post-metadata">

**Author:** ![Tim\_Roberts](https://avatars.discourse-cdn.com/v4/letter/t/e68b1a/32.png) [@Tim\_Roberts](https://rubytalk.org/u/Tim_Roberts)\
**Post date:** [22 November 2010 04:30 UTC](https://rubytalk.org/t/why-i-cant-find-my-ruby/60913/9 "2010-11-22T04:30:20Z")

</div>

> 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

No, it's not. You use sudo only when it is absolutely required, and as  
with virtually every package you can download, the ONLY step here that  
needs the sudo is the "make install". You can build it as a normal user.  
So:

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=/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  
> sudo gedit /etc/environment
> 
> PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/ruby/bin"

If you are adding /usr/local/ruby/bin to your path, then the two symbolic  
links are unnecessary. Further, if you want the links in /usr/bin, why not  
just skip the prefix altogether?

> **···**
>
> Pen Ttt \<myocean135@yahoo.cn\> wrote:  
> --  
> Tim Roberts, timr@probo.com  
> Providenza & Boekelheide, Inc.

---

<div class="post-metadata">

**Author:** ![niklas\_brueckenschla](https://avatars.discourse-cdn.com/v4/letter/n/41988e/32.png) [@niklas\_brueckenschla](https://rubytalk.org/u/niklas_brueckenschla)\
**Post date:** [29 November 2010 12:06 UTC](https://rubytalk.org/t/why-i-cant-find-my-ruby/60913/10 "2010-11-29T12:06:26Z")

</div>

typing "irb" & pressing TAB doesn't get you anywhere?

> **···**
>
> On Mon, 2010-11-29 at 21:04 +0900, Pen Ttt wrote:
> 
> > 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?

---

<div class="post-metadata">

**Author:** ![Lucas\_Nussbaum1](https://avatars.discourse-cdn.com/v4/letter/l/4da419/32.png) [@Lucas\_Nussbaum1](https://rubytalk.org/u/Lucas_Nussbaum1)\
**Post date:** [29 November 2010 12:23 UTC](https://rubytalk.org/t/why-i-cant-find-my-ruby/60913/11 "2010-11-29T12:23:29Z")

</div>

How did you install ruby?

- Lucas

> **···**
>
> On 29/11/10 at 21:04 +0900, Pen Ttt wrote:
> 
> > 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?

---

<div class="post-metadata">

**Author:** ![botp1](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@botp1](https://rubytalk.org/u/botp1)\
**Post date:** [29 November 2010 12:36 UTC](https://rubytalk.org/t/why-i-cant-find-my-ruby/60913/12 "2010-11-29T12:36:35Z")

</div>

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

best regards -botp

> **···**
>
> On Mon, Nov 29, 2010 at 8:04 PM, Pen Ttt \<myocean135@yahoo.cn\> wrote:
> 
> > 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?

---

<div class="post-metadata">

**Author:** ![Pen\_Ttt](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@Pen\_Ttt](https://rubytalk.org/u/Pen_Ttt)\
**Post date:** [29 November 2010 12:21 UTC](https://rubytalk.org/t/why-i-cant-find-my-ruby/60913/13 "2010-11-29T12:21:46Z")

</div>

"irb" +pressing TAB ，nothing 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/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

**Author:** ![Pen\_Ttt](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@Pen\_Ttt](https://rubytalk.org/u/Pen_Ttt)\
**Post date:** [29 November 2010 12:31 UTC](https://rubytalk.org/t/why-i-cant-find-my-ruby/60913/14 "2010-11-29T12:31:48Z")

</div>

wget [ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p0.tar.bz2](http://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

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

**Author:** ![Peter\_Vandenabeele1](https://avatars.discourse-cdn.com/v4/letter/p/59ef9b/32.png) [@Peter\_Vandenabeele1](https://rubytalk.org/u/Peter_Vandenabeele1)\
**Post date:** [29 November 2010 12:37 UTC](https://rubytalk.org/t/why-i-cant-find-my-ruby/60913/15 "2010-11-29T12:37:56Z")

</div>

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

> **···**
>
> On Mon, Nov 29, 2010 at 1:21 PM, Pen Ttt \<myocean135@yahoo.cn\> wrote:
> 
> > "irb" +pressing TAB ，nothing 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/\](http://www.ruby-forum.com/%5C).
> 
> --  
> Peter Vandenabeele  
> gsm: +32-478-27.40.69  
> e-mail: peter@vandenabeele.com  
> [http://twitter.com/peter\_v](http://twitter.com/peter_v)

---

<div class="post-metadata">

**Author:** ![Lucas\_Nussbaum1](https://avatars.discourse-cdn.com/v4/letter/l/4da419/32.png) [@Lucas\_Nussbaum1](https://rubytalk.org/u/Lucas_Nussbaum1)\
**Post date:** [29 November 2010 14:14 UTC](https://rubytalk.org/t/why-i-cant-find-my-ruby/60913/16 "2010-11-29T14:14:36Z")

</div>

Then ruby isn't in your $PATH.

Have you tried your distribution's packages?

- Lucas

> **···**
>
> On 29/11/10 at 21:31 +0900, Pen Ttt wrote:
> 
> > 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

---

<div class="post-metadata">

**Author:** ![Pen\_Ttt](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@Pen\_Ttt](https://rubytalk.org/u/Pen_Ttt)\
**Post date:** [29 November 2010 12:43 UTC](https://rubytalk.org/t/why-i-cant-find-my-ruby/60913/17 "2010-11-29T12:43:18Z")

</div>

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

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

**Author:** ![Peter\_Vandenabeele1](https://avatars.discourse-cdn.com/v4/letter/p/59ef9b/32.png) [@Peter\_Vandenabeele1](https://rubytalk.org/u/Peter_Vandenabeele1)\
**Post date:** [29 November 2010 12:50 UTC](https://rubytalk.org/t/why-i-cant-find-my-ruby/60913/18 "2010-11-29T12:50:36Z")

</div>

(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=/usr/local/ruby/bin:"${PATH}"

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

HTH,

Peter

> **···**
>
> On Mon, Nov 29, 2010 at 1:43 PM, Pen Ttt \<myocean135@yahoo.cn\> wrote:
> 
> > 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
