Upgrading RVM'd Ruby on OSX Lion
I found out the hard way that upgrading my RVM-managed Ruby 1.9.2 install to the latest patch level upstream isn't as straightforward if you had that Ruby version installed prior to an upgrade to OSX Lion. Given that OSX Lion is fully 64-bit, all libraries will have to be recompiled to 64-bit: a fact that bit me hard as all those libraries that I have installed via MacPorts and Homebrew will have to be recompiled before I can even dare upgrade Ruby.
What I did is a bit drastic, but worked for me. Any suggestions to do this better will be most welcome:
- Upgrade to the latest MacPorts (2.0.1 as of this writing) that is compatible with OSX Lion.
- Upgrade the following libraries in MacPorts or Homebrew: libiconv, libxml2, libxslt, readline, openssl, zlib. You may have to uninstall these libraries first if the compile bails out due to linkage errors between 32-bit and 64-bit libraries.
- Install the latest Ruby via RVM, e.g. rvm install 1.9.2-p290 --with-readline-dir=/opt/local --with-openssl-dir=/opt/local --with-iconv-dir=/opt/local --with-zlib-dir=/opt/local.