Installing 1.9

I finally got the 1.9 itch bad enough. I didn’t see any brainlessly simple “Install Ruby 1.9 alongside 1.8.x” guides, and as I’m relatively new to serious Unix-y system usage I like those kinds of things. Anyway, in the event that someone’s looking for a brainlessly simple “Install Ruby 1.9 alongside 1.8.x” guide:

svn co http://svn.ruby-lang.org/repos/ruby/trunk ruby19
cd ruby19
autoconf
./configure --prefix=/usr/local --program-suffix=19 --with-readline-dir=/usr/local
make
sudo make install

Certainly, old hands have this down, and much of this is in the README. But the secret is --program-suffix=19, which leaves ruby alone and gives you ruby19 as your 1.9 executable.

Then I ran the benchmark stuff from this thread, and here’s how it went:

mvb:~ cms$ ruby calculate.rb
55

Ruby 1.8.6 patch 0 on i686-darwin8.9.1
It took 9.167413 seconds to run. 109082 iterations per
second.
mvb:~ cms$ ruby19 calculate.rb
55

Ruby 1.9.0 patch 0 on i686-darwin8.10.1
It took 3.059674 seconds to run. 326832 iterations per
second.

5 Comments »

  1. Stephane said,

    October 16, 2007 @ 2:32 am

    thanks useful :)

  2. Ruby, a message to you » Wirble in Ruby 1.9 said,

    November 29, 2007 @ 6:16 pm

    [...] if you’re using 1.9 alongside 1.8, it’s nice when everything works the same. And so, here’s a simple patch for wirble.rb [...]

  3. Ruby 1.9 « Bernardo Rufino said,

    January 1, 2008 @ 8:59 pm

    [...] Ruby 1.9 Antes de tudo um feliz ano novo para todos! Como todos já devem saber o Ruby 1.9 já foi lançado, e como um presente de natal, justamente no dia 25. Como o próprio Matz disse, essa ainda não é uma versão totalmente estável e nem para ser usada em produção, não a recebe como substituta do Ruby 1.8, ela é experimental ainda. Tivemos grande mudanças como YARV, threads nativas, mais splats de Arrays, UTF-8, métodos de Enumerable sem bloco, veja mais mudanças. Veja um tutorial para instalar o Ruby 1.9 [...]

  4. Nikos D. said,

    April 21, 2008 @ 10:06 am

    Migrating to Ruby 1.9 (YARV): Posts you have to re…

    So, you are reading everywhere that Ruby 1.9 is faster than 1.8 (even I say so! :D ) and you want to give it a try or even port your existing code to it. Where should you start from?…

  5. Ruby 1.9 porting notes « Boga Mac blog said,

    May 3, 2008 @ 4:01 am

    [...] Installing ruby 1.9 on MacOSX [...]

RSS feed for comments on this post · TrackBack URI

Leave a Comment