Monday, March 10, 2008

Installing Ruby 1.9 on Mac OS X with Ruby 1.8 Intact

Install ReadLine

cd /temp
curl -O http://ftp.gnu.org/gnu/readline/readline-5.2.tar.gz
tar xvzf readline-5.2.tar.gz
cd readline-5.2
./configure --prefix=/Users/balaparanj/
sudo make
sudo make install

Install Ruby 1.9

cd /temp
curl -O ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.0-0.tar.gz
tar xzvf ruby-1.9.0-0.tar.gz
cd ruby-1.9.0-0
autoconf
sudo ./configure --prefix=/Users/balaparanj/ruby19 --with-readline-dir=/Users/balaparanj/
sudo make
sudo make install

3 comments:

  1. Thanks for this post.

    However, whenever I run the readline make I get the following error: -

    gcc version 4.0.1 (Apple Inc. build 5465)
    i686-apple-darwin9-gcc-4.0.1: -compatibility_version only allowed with -dynamiclib
    make[1]: *** [libreadline.5.2.dylib] Error 1

    I've checked to make sure I have the latest gcc but everything appears fine. Any ideas?

    ReplyDelete
  2. curl -O ftp://ftp.gnu.org/gnu/readline/readline-5.2.tar.gz
    tar xzvf readline-5.2.tar.gz
    cd readline-5.2
    curl -O http://ftp.gnu.org/gnu/readline/readline-5.2-patches/readline52-012
    patch -p0 < readline52-012
    ./configure --prefix=/Users/balaparanj/
    make
    sudo make install
    cd ..
    curl -O ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.0-3.tar.gz
    tar xzvf ruby-1.9.0-3.tar.gz
    cd ruby-1.9.0-r18217
    autoconf
    sudo ./configure --prefix=/Users/balaparanj/ruby19 --with-readline-dir=/Users/balaparanj/
    sudo make
    sudo make install

    ReplyDelete