I used to use rvm to manage my ruby environment, but the latest hotness seems to be rbenv. Here are some tips about using it. They’re aimed at me, because by the next time I need to use it, I’ll have forgotten. But you can read them too:
One of the things you want is rbenv-build:
Installing ruby-build as an rbenv plugin will give you access to the rbenv install command.
$ mkdir -p ~/.rbenv/plugins $ cd ~/.rbenv/plugins $ git clone git://github.com/sstephenson/ruby-build.git(Note the assumption you’re using git. I don’t know what people who prefer mercurial are supposed to do.)
This will install the latest development version of ruby-build into the ~/.rbenv/plugins/ruby-build directory. From that directory, you can check out a specific release tag. To update ruby-build, run
git pull
to download the latest changes.
But that won’t work with Mountain Lion. So you’ll need a version of ruby that can be built with clang.
$ rbenv install 1.9.3-p125