chruby: A Ruby Switcher I Can Live With

I’ve never really been happy with rvm. It always felt like it was trying to do too much. And, I really didn’t see the point of using gemsets when we have bundler. I used rbenv for a while, and it worked pretty well. But all I really wanted was a simple way to switch between ruby binaries. Basically, this boils down to updating $PATH. Before I used rbenv, I had been doing this manually.

Enter chruby. Chruby is a simple shell script does one thing, and does it well: switch between ruby versions. It does this by updating $PATH. You can install your rubies anywhere you want and chruby provides a command to switch between them by updating $PATH. By default it looks for rubies in /opt/rubies or ~/.rubies. It will find your system ruby, if installed, and allow you to switch between that as well. It correctly sets $GEM_HOME and $GEM_PATH, which can be confusing if don’t know what those environmental variable do.

I’m using chruby on most of my systems now, and I’ll probably stick with it until the next greatest ruby switcher comes along. Give it a try yourself!

Related Posts