# Help! Window user needs help installing ruby 1.9 on mac

**URL:** <https://www.ruby-forum.com/t/help-window-user-needs-help-installing-ruby-1-9-on-mac/164697>\
**Category:** Ruby\
**Created:** [April 4, 2009, 7:55am UTC](https://www.ruby-forum.com/t/help-window-user-needs-help-installing-ruby-1-9-on-mac/164697 "2009-04-04T07:55:55Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![devrubygem](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ac8455/32.png) [@devrubygem](https://www.ruby-forum.com/u/devrubygem)\
**Post date:** [April 4, 2009, 7:55am UTC](https://www.ruby-forum.com/t/help-window-user-needs-help-installing-ruby-1-9-on-mac/164697/1 "2009-04-04T07:55:55Z")

</div>

I just purchased a new macbook pro and would like to install ruby 1.9,  
but I’m having trouble installing, can someone please provide the  
easiest steps to install ruby 1.9 please?

Thanks

---

<div class="post-metadata">

**Author:** ![devrubygem](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ac8455/32.png) [@devrubygem](https://www.ruby-forum.com/u/devrubygem)\
**Post date:** [April 4, 2009, 1:19pm UTC](https://www.ruby-forum.com/t/help-window-user-needs-help-installing-ruby-1-9-on-mac/164697/2 "2009-04-04T13:19:07Z")

</div>

Install macports. Then:  
sudo port install ruby19

Should do it.

Ben

---

<div class="post-metadata">

**Author:** ![devrubygem](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ac8455/32.png) [@devrubygem](https://www.ruby-forum.com/u/devrubygem)\
**Post date:** [April 4, 2009, 5:31pm UTC](https://www.ruby-forum.com/t/help-window-user-needs-help-installing-ruby-1-9-on-mac/164697/3 "2009-04-04T17:31:41Z")

</div>

Ben L. wrote:

> Install macports. Then:  
> sudo port install ruby19
> 
> Should do it.
> 
> Ben

Thanks Ben, that helped a great deal, 1.9 is installed successfully on  
my machine.

Kindest Regards

---

<div class="post-metadata">

**Author:** ![devrubygem](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ac8455/32.png) [@devrubygem](https://www.ruby-forum.com/u/devrubygem)\
**Post date:** [April 4, 2009, 6:24pm UTC](https://www.ruby-forum.com/t/help-window-user-needs-help-installing-ruby-1-9-on-mac/164697/4 "2009-04-04T18:24:38Z")

</div>

Great. You’ll find macports pretty handy for installing many things.

---

<div class="post-metadata">

**Author:** ![devrubygem](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ac8455/32.png) [@devrubygem](https://www.ruby-forum.com/u/devrubygem)\
**Post date:** [April 4, 2009, 6:32pm UTC](https://www.ruby-forum.com/t/help-window-user-needs-help-installing-ruby-1-9-on-mac/164697/5 "2009-04-04T18:32:36Z")

</div>

Ben L. wrote:

> Great. You’ll find macports pretty handy for installing many things.

Cool. One thing I’m noticing is when I type /usr/bin/ruby -v it is  
giving me version 1.8, when I’m compiling my code how do I know which  
version of ruby I’m using? 1.9 is installed in my /opt/local/lib  
directory.  
Should I uninstall 1.8?

Thanks

---

<div class="post-metadata">

**Author:** ![devrubygem](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ac8455/32.png) [@devrubygem](https://www.ruby-forum.com/u/devrubygem)\
**Post date:** [April 4, 2009, 7:19pm UTC](https://www.ruby-forum.com/t/help-window-user-needs-help-installing-ruby-1-9-on-mac/164697/6 "2009-04-04T19:19:09Z")

</div>

On Apr 4, 2009, at 12:32 PM, Zayd C. wrote:

> Ben L. wrote:
> 
> > Great. You’ll find macports pretty handy for installing many things.
> 
> Cool. One thing I’m noticing is when I type /usr/bin/ruby -v it is  
> giving me version 1.8, when I’m compiling my code how do I know which  
> version of ruby I’m using? 1.9 is installed in my /opt/local/lib

at the prompt, type which ruby and that will give you the  
path to the executable

also, you might want to check your PATH env variable to make sure it’s  
finding the right one first, although I think OSX has a mechanism for  
switching that’s kind of a half baked version of the Linux  
alternatives mechanism for switching between various versions of  
“stuff”. Although, in fairness this seems to work quite well for java  
on the mac. Anyway, check your path with either echo $PATH of env  
commands and see what it says. You may have to force it by modifying  
the path in .bash\_profile in your home directory (assuming bash) or  
some other file that’s modifying your path variable. Hope that helps.

---

<div class="post-metadata">

**Author:** ![devrubygem](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ac8455/32.png) [@devrubygem](https://www.ruby-forum.com/u/devrubygem)\
**Post date:** [April 4, 2009, 6:52pm UTC](https://www.ruby-forum.com/t/help-window-user-needs-help-installing-ruby-1-9-on-mac/164697/7 "2009-04-04T18:52:11Z")

</div>

On Sat, Apr 4, 2009 at 5:32 PM, Zayd C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Cool. One thing I’m noticing is when I type /usr/bin/ruby -v it is  
> giving me version 1.8, when I’m compiling my code how do I know which  
> version of ruby I’m using? 1.9 is installed in my /opt/local/lib  
> directory.  
> Should I uninstall 1.8?

Take a look at this article:

[http://www.metaskills.net/2009/1/20/multiruby-the-macports-way-testing-your-rails-apps-with-ruby-1-9](http://www.metaskills.net/2009/1/20/multiruby-the-macports-way-testing-your-rails-apps-with-ruby-1-9)

Although it is a little hackish I’m not sure of any easier method.

Ben

---

<div class="post-metadata">

**Author:** ![devrubygem](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ac8455/32.png) [@devrubygem](https://www.ruby-forum.com/u/devrubygem)\
**Post date:** [April 6, 2009, 10:53pm UTC](https://www.ruby-forum.com/t/help-window-user-needs-help-installing-ruby-1-9-on-mac/164697/8 "2009-04-06T22:53:29Z")

</div>

Dom wrote:

> On Apr 4, 2009, at 12:32 PM, Zayd C. wrote:
> 
> > Ben L. wrote:
> > 
> > > Great. You’ll find macports pretty handy for installing many things.
> > 
> > Cool. One thing I’m noticing is when I type /usr/bin/ruby -v it is  
> > giving me version 1.8, when I’m compiling my code how do I know which  
> > version of ruby I’m using? 1.9 is installed in my /opt/local/lib
> 
> at the prompt, type which ruby and that will give you the  
> path to the executable
> 
> also, you might want to check your PATH env variable to make sure it’s  
> finding the right one first, although I think OSX has a mechanism for  
> switching that’s kind of a half baked version of the Linux  
> alternatives mechanism for switching between various versions of  
> “stuff”. Although, in fairness this seems to work quite well for java  
> on the mac. Anyway, check your path with either echo $PATH of env  
> commands and see what it says. You may have to force it by modifying  
> the path in .bash\_profile in your home directory (assuming bash) or  
> some other file that’s modifying your path variable. Hope that helps.

Sorry but I cannot find the file to modify my path env variable.

Thanks

---

<div class="post-metadata">

**Author:** ![devrubygem](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ac8455/32.png) [@devrubygem](https://www.ruby-forum.com/u/devrubygem)\
**Post date:** [April 4, 2009, 7:36pm UTC](https://www.ruby-forum.com/t/help-window-user-needs-help-installing-ruby-1-9-on-mac/164697/9 "2009-04-04T19:36:44Z")

</div>

On Sat, Apr 4, 2009 at 9:49 AM, Ben L. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Although it is a little hackish I’m not sure of any easier method.

I always install alternative versions of any software into different  
directories, e.g.  
/usr/local/ruby-1.8.6  
/usr/local/ruby-1.8.7  
/usr/local/ruby-1.9.1

## set the default path in your .bashrc.local or equiv, and then use a file like, say “r187”

## export RUBY\_HOME=/usr/local/ruby-1.8.7 export PATH=$RUBY\_HOME/bin:$PATH

for each version. Then in any window you can type  
prompt\> . r187

and set the version for that particular shell.

FWIW,
