Ruby 1.9 on Mac OS X
UPDATE: use this instead Ruby Version Manager
Quick steps for installing Ruby 1.9.1 while preserving the existing ruby installation.
Things to know before following these directions:
- I don’t use MacPorts or Fink. There is nothing wrong with using either of them, I just prefer not to.
- I’m doing this on an Intel Mac running Mac OS X 10.5.7, no guarantees for any other
- architecture or OS X version
- i use ~/source for most of my development work.
- I wrote this for some of my less system minded co-workers
Install GNU Readline. Skip this step if you already have readline installed. You may also use Fink or MacPorts to install.
- cd ~/source
- curl -O http://ftp.gnu.org/gnu/readline/readline-6.0.tar.gz
- tar xvzf readline-6.0.tar.gz
- cd readline-6.0
- ./configure
- make
- sudo make install
- Install Ruby 1.9.1:
- cd ~/source
- svn co -r23858 http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1
- cd ruby_1_9_1
- ./configure –prefix=/opt/ruby -enable-shared –with-readline-dir=/usr/local (if you already have readline installed, change the last part accordingly)
- make
- sudo make install
- cd ~
- vim .bash_profile
- add this line: alias ruby-19=’export PATH=/opt/ruby/bin:$PATH’
- save the file and exit vim
Install notes for some common gems:
- enter ruby -v to make sure you’re using the correct version of ruby. It should report version
- 1.9.1p203, if not, enter the ruby-19 command created above.
- MySQL - install hectoregm-mysql-ruby. The mysql gem doesn’t work on Ruby 1.9
- rspec and rspec-rails. You need to also install test-unit v1.2.3 for rspec-rails to work properly.
- Make sure that v1.2.3 is the only one installed. If you also have a newer version installed, things won’t work.
- mongrel - needs to be patched using these directions http://isitruby19.com/mongrel . If you followed my directions, change the path in step 1 to /opt/ruby19/lib/ruby/gems/1.9.1/gems/mongrel-1.1.5/ext/http11
- mongrel_cluster
- check http://isitruby19.com for other gems




