# 1.9 on OS X

**URL:** <https://www.ruby-forum.com/t/1-9-on-os-x/161717>\
**Category:** Ruby\
**Created:** [March 1, 2009, 5:15pm UTC](https://www.ruby-forum.com/t/1-9-on-os-x/161717 "2009-03-01T17:15:45Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sprsquish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/d9b06d/32.png) [@sprsquish](https://www.ruby-forum.com/u/sprsquish)\
**Post date:** [March 1, 2009, 5:15pm UTC](https://www.ruby-forum.com/t/1-9-on-os-x/161717/1 "2009-03-01T17:15:45Z")

</div>

What is the best way to install Ruby 1.9 on Apple OS X?

The latest version in fink is 1.8.6, which I’m currently using. I did  
not see this discussion in the c.l.r archives, but please feel free to  
point me to them.

---

<div class="post-metadata">

**Author:** ![sprsquish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/d9b06d/32.png) [@sprsquish](https://www.ruby-forum.com/u/sprsquish)\
**Post date:** [March 1, 2009, 5:41pm UTC](https://www.ruby-forum.com/t/1-9-on-os-x/161717/2 "2009-03-01T17:41:41Z")

</div>

Jeff S. wrote:

> What is the best way to install Ruby 1.9 on Apple OS X?
> 
> The latest version in fink is 1.8.6, which I’m currently using. I did  
> not see this discussion in the c.l.r archives, but please feel free to  
> point me to them.

Download the tarball from [ruby-lang.org](http://ruby-lang.org), configure, make, make install.

Make sure you’ve got /usr/local at the beginning of your $PATH, or, if  
you want to use 1.9 alongside 1.8.6, use the --program-suffix= option to  
append “19” to the executable names. Use “./configure --help” for more  
information.

---

<div class="post-metadata">

**Author:** ![sprsquish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/d9b06d/32.png) [@sprsquish](https://www.ruby-forum.com/u/sprsquish)\
**Post date:** [March 1, 2009, 5:55pm UTC](https://www.ruby-forum.com/t/1-9-on-os-x/161717/3 "2009-03-01T17:55:47Z")

</div>

Tim H. wrote:

> Make sure you’ve got /usr/local at the beginning of your $PATH, or, if  
> you want to use 1.9 alongside 1.8.6, use the --program-suffix= option to  
> append “19” to the executable names. Use “./configure --help” for more  
> information.

Thanks. Ordinarily, when I do that dance, I use --prefix to install  
multiple versions in different directories, and to make uninstallation  
feasible.

Once I have two versions installed, how do I tell (e.g.) Rails which  
version to use?

---

<div class="post-metadata">

**Author:** ![sprsquish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/d9b06d/32.png) [@sprsquish](https://www.ruby-forum.com/u/sprsquish)\
**Post date:** [March 1, 2009, 5:56pm UTC](https://www.ruby-forum.com/t/1-9-on-os-x/161717/4 "2009-03-01T17:56:59Z")

</div>

On Sun, Mar 1, 2009 at 10:09 PM, Tim H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Jeff S. wrote:
> 
> > What is the best way to install Ruby 1.9 on Apple OS X?  
> > Download the tarball from [ruby-lang.org](http://ruby-lang.org), configure, make, make install.
> 
> Make sure you’ve got /usr/local at the beginning of your $PATH, or, if you  
> want to use 1.9 alongside 1.8.6, use the --program-suffix= option to append  
> “19” to the executable names. Use “./configure --help” for more information.

YMMV but i had some trouble with gem executable conflicts using the  
program-suffix scheme. Also with she-bang lines in scripts.

I’ve had much less trouble with 1.9 in its own sandbox (e.g. under  
/usr/local/ruby-1.9) and a little script to modify my $PATH whenever i  
want to switch between 1.8 and 1.9.

And for the sake of completeness i should mention macports has a  
ruby19 package (which installs with the aforementiond suffixes by  
default).

Solidarity,  
lasitha.

---

<div class="post-metadata">

**Author:** ![sprsquish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/d9b06d/32.png) [@sprsquish](https://www.ruby-forum.com/u/sprsquish)\
**Post date:** [March 1, 2009, 7:17pm UTC](https://www.ruby-forum.com/t/1-9-on-os-x/161717/5 "2009-03-01T19:17:45Z")

</div>

On 1 mars 09, at 17:13, Jeff S. wrote:

> What is the best way to install Ruby 1.9 on Apple OS X?

MacPorts, which allows to install and use both Ruby 1.8 and Ruby 1.9  
at the same time.

---

<div class="post-metadata">

**Author:** ![sprsquish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/d9b06d/32.png) [@sprsquish](https://www.ruby-forum.com/u/sprsquish)\
**Post date:** [March 1, 2009, 9:31pm UTC](https://www.ruby-forum.com/t/1-9-on-os-x/161717/6 "2009-03-01T21:31:02Z")

</div>

As already mentioned, MacPorts works fine. It gives you the option of  
having separate binaries for 1.8 & 1.9 (ruby1.8 / ruby1.9, irb1.8 /  
irb1.9…) or having only one (ruby, irb). But with the last option  
you can’t have both versions installed at the same time, although you  
can activate & deactivate ports pretty fast.

---

<div class="post-metadata">

**Author:** ![sprsquish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/d9b06d/32.png) [@sprsquish](https://www.ruby-forum.com/u/sprsquish)\
**Post date:** [March 1, 2009, 8:34pm UTC](https://www.ruby-forum.com/t/1-9-on-os-x/161717/7 "2009-03-01T20:34:30Z")

</div>

Luc H. wrote:

> On 1 mars 09, at 17:13, Jeff S. wrote:
> 
> > What is the best way to install Ruby 1.9 on Apple OS X?
> 
> MacPorts, which allows to install and use both Ruby 1.8 and Ruby 1.9  
> at the same time.

I used MacPorts to install 1.9.1 alongside 1.8 – totally painless. Then  
if you want to use  
irb with 1.9, simply type “irb19” in Terminal and you will be running  
under 1.9.1. (Check  
this using “RUBY\_VERSION” in Terminal with irb running).

I’m not sure about Rails, but I simply altered my shebang line and Ruby  
1.9.1 is  
working in Textmate:

#!/opt/local/bin/ruby1.9

Macports installs ruby19 into /opt/local/bin along with a few other  
files.

vince
