Switching from rbenv to postmodern’s ruby-install and chruby

Dec 26, 2015 · 2 min read

Update: I’ve moved my blog to Hashnode. You can visit it here.

I’ve seen many people switch over from rvm and rbenv to ruby-install and chruby. They are both small and simple tools to install ruby versions and switch between them.

Uninstalling current tools

Start by getting rid of your current tools. I’m on OS X and I’ve installed rbenv, ruby-build and a few other rbenv extensions through homebrew. I start by uninstalling them using homebrew.

Also remove any rbenv specific stuff from your shell init file and $PATH. It’s possible to migrate seamlessly from rbenv to chruby but I preferred to start clean.

Installing ruby-install

Then install ruby-install according to instructions. In my case using homebrew.

Once that finished I just wanted the latest stable version of ruby for my system.

This will install the latest stable ruby version into ~/.rubies. To install a specific version of ruby just add the version number.

Installing chruby

Next up install chruby according to instructions. I installed it using homebrew.

If you’re keeping your old ruby installations then refer to the migrating instructions. I wasn’t so all I have to do is add the following lines to my shell startup script, ~/.zshrc.

Note that the second line is optional and only needed if you use .ruby-version files, which I do. Then activate chruby.

I added a .ruby-version in my home directory to tell chruby to use the version I just installed

Then run ruby -v to confirm it worked.

For existing projects all that is needed is to install the ruby version required and use .ruby-version to tell chruby to use it. You’ll need to reinstall any gems as well. I did this for a rails project running ruby 2.2.3.

Now it’s possible to install ruby versions and change between them. That’s all I need. Both ruby-install and chruby are small and simple, they do one thing and they do it well, and the source code is short and easy to get your head around.

Feel free to connect with me on Twitter or visit my website for more information about me.


Written by


I write software and make stuff.