# Intstalled Ruby 1.8.7 but still getting ruby -v =\> 1.8.6

**URL:** <https://www.ruby-forum.com/t/intstalled-ruby-1-8-7-but-still-getting-ruby-v-1-8-6/193404>\
**Category:** Ruby\
**Created:** [August 17, 2010, 6:37am UTC](https://www.ruby-forum.com/t/intstalled-ruby-1-8-7-but-still-getting-ruby-v-1-8-6/193404 "2010-08-17T06:37:21Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mitch\_newbie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea5d25/32.png) [@mitch\_newbie](https://www.ruby-forum.com/u/mitch_newbie)\
**Post date:** [August 17, 2010, 6:37am UTC](https://www.ruby-forum.com/t/intstalled-ruby-1-8-7-but-still-getting-ruby-v-1-8-6/193404/1 "2010-08-17T06:37:21Z")

</div>

I have followed the instructions to install ruby 1.8.7. Everything seems  
to have installed as best that I can determine.

However when I run the command

ruby -v

I get

ruby 1.8.6 (2009-06-08 patchlevel 369) [universal-darwin9.0]

Why is that?

Also do I have to tell my Rails application to use 1.8.7 and if so how  
do I do this?

Thank you in advance

Mitchell

---

<div class="post-metadata">

**Author:** ![mitch\_newbie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea5d25/32.png) [@mitch\_newbie](https://www.ruby-forum.com/u/mitch_newbie)\
**Post date:** [August 17, 2010, 11:59am UTC](https://www.ruby-forum.com/t/intstalled-ruby-1-8-7-but-still-getting-ruby-v-1-8-6/193404/2 "2010-08-17T11:59:15Z")

</div>

Mitchell G. wrote:

> I have followed the instructions to install ruby 1.8.7.

Which instructions? What did you do? On what platform? The question  
as-is is missing important information.

> However when I run the command
> 
> ruby -v
> 
> I get
> 
> ruby 1.8.6 (2009-06-08 patchlevel 369) [universal-darwin9.0]

Then I can guess you’re on a Mac, at least.

> Why is that?

“which ruby” will tell you where it found it. Presumably your other  
installation is either not in $PATH or is later in $PATH; or it was  
installed under a different name (e.g. “ruby187” instead of “ruby”).

> Also do I have to tell my Rails application to use 1.8.7 and if so how  
> do I do this?

You will probably need to reinstall all your gems, including rails,  
using 1.8.7 so they will go in 1.8.7’s gems directory. If you build ruby  
from source, then you will likely need to build rubygems itself from  
source first.

---

<div class="post-metadata">

**Author:** ![mitch\_newbie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea5d25/32.png) [@mitch\_newbie](https://www.ruby-forum.com/u/mitch_newbie)\
**Post date:** [August 17, 2010, 12:59pm UTC](https://www.ruby-forum.com/t/intstalled-ruby-1-8-7-but-still-getting-ruby-v-1-8-6/193404/3 "2010-08-17T12:59:45Z")

</div>

Brian C. wrote:

> Mitchell G. wrote:
> 
> > I have followed the instructions to install ruby 1.8.7.
> 
> Which instructions? What did you do? On what platform? The question  
> as-is is missing important information.

I followed these instructions that were posted on this forum.

[http://www.ruby-forum.com/topic/154868](http://www.ruby-forum.com/topic/154868)

> > However when I run the command
> > 
> > ruby -v
> > 
> > I get
> > 
> > ruby 1.8.6 (2009-06-08 patchlevel 369) [universal-darwin9.0]
> 
> Then I can guess you’re on a Mac, at least.
> 
> > Why is that?
> 
> “which ruby” will tell you where it found it. Presumably your other  
> installation is either not in $PATH or is later in $PATH; or it was  
> installed under a different name (e.g. “ruby187” instead of “ruby”).
> 
> > Also do I have to tell my Rails application to use 1.8.7 and if so how  
> > do I do this?
> 
> You will probably need to reinstall all your gems, including rails,  
> using 1.8.7 so they will go in 1.8.7’s gems directory. If you build ruby  
> from source, then you will likely need to build rubygems itself from  
> source first.

---

<div class="post-metadata">

**Author:** ![mitch\_newbie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea5d25/32.png) [@mitch\_newbie](https://www.ruby-forum.com/u/mitch_newbie)\
**Post date:** [August 17, 2010, 5:39pm UTC](https://www.ruby-forum.com/t/intstalled-ruby-1-8-7-but-still-getting-ruby-v-1-8-6/193404/4 "2010-08-17T17:39:00Z")

</div>

> However when I run the command
> 
> ruby -v
> 
> I get
> 
> ruby 1.8.6 (2009-06-08 patchlevel 369) [universal-darwin9.0]
> 
> Why is that?

running “whereis ruby” will probably tell you which one it is using, and  
if there are multiples on your path or not (it uses the first).  
The “whichr” gem will do the same (install it, run “whichr ruby”)  
Cheers.  
-r

---

<div class="post-metadata">

**Author:** ![mitch\_newbie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea5d25/32.png) [@mitch\_newbie](https://www.ruby-forum.com/u/mitch_newbie)\
**Post date:** [August 17, 2010, 1:23pm UTC](https://www.ruby-forum.com/t/intstalled-ruby-1-8-7-but-still-getting-ruby-v-1-8-6/193404/5 "2010-08-17T13:23:24Z")

</div>

Mitchell G. wrote:

> I followed these instructions that were posted on this forum.
> 
> [Installing 1.8.7 - Ruby - Ruby-Forum](http://www.ruby-forum.com/topic/154868)

Did you do a plain “./configure” or did you add any options to it?

If not, then your new ruby should be in /usr/local/bin. Try this:

/usr/local/bin/ruby -v

If that works, but ruby -v still gives 1.8.6, then show us the output of

echo $PATH

---

<div class="post-metadata">

**Author:** ![mitch\_newbie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea5d25/32.png) [@mitch\_newbie](https://www.ruby-forum.com/u/mitch_newbie)\
**Post date:** [August 18, 2010, 12:43pm UTC](https://www.ruby-forum.com/t/intstalled-ruby-1-8-7-but-still-getting-ruby-v-1-8-6/193404/6 "2010-08-18T12:43:56Z")

</div>

Brian C. wrote:

> Mitchell G. wrote:
> 
> > I followed these instructions that were posted on this forum.
> > 
> > [Installing 1.8.7 - Ruby - Ruby-Forum](http://www.ruby-forum.com/topic/154868)
> 
> Did you do a plain “./configure” or did you add any options to it?
> 
> If not, then your new ruby should be in /usr/local/bin. Try this:
> 
> /usr/local/bin/ruby -v
> 
> If that works, but ruby -v still gives 1.8.6, then show us the output of
> 
> echo $PATH

I Did not do any options when I installed. However I have discovered  
that my ruby 1.8.6 is installed in /usr/bin/ not /usr/local/bin but my  
new ruby 1.8.7 is installed in /usr/local/bin.

Should I reinstall ruby 1.8.7 in usr/bin where ruby 1.8.6 is installed?

echo $PATH  
/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin

Thanks for your help.

---

<div class="post-metadata">

**Author:** ![mitch\_newbie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea5d25/32.png) [@mitch\_newbie](https://www.ruby-forum.com/u/mitch_newbie)\
**Post date:** [August 18, 2010, 5:10pm UTC](https://www.ruby-forum.com/t/intstalled-ruby-1-8-7-but-still-getting-ruby-v-1-8-6/193404/7 "2010-08-18T17:10:51Z")

</div>

> Should I reinstall ruby 1.8.7 in usr/bin where ruby 1.8.6 is installed?

I would just rename /usr/bin/ruby to /usr/bin/ruby\_old or something.  
But that’s just me, and I’m a bit lazy.  
-r
