Rbenv: How to Use It To Manage Your Rubies

While working with ruby, you have some alternatives to manage your binaries using rbenv,
but as you think of them, I hope you are not really considering delegating this
task directly to your OS package manager since it is discouraged, otherwise you
would end up with a messy workstation.

There are a few tools that allow you to manage your rubies and gems, the most
popular among them is, without doubts, RVM
(Ruby Version Manager) which in all fairness is good, it provides a CLI to
switch between your rubies and gemsets. If you haven’t used RVM, you should
read this guide.

Even when RVM is great, there are a couple of things that I don’t like about it:

Personally, I had a painful situation as a Linux user, every time I wanted to
get a fresh ruby version with support for readline and zlib libraries and its
dependencies.

Its gemset management feature tends to duplicate gems across your projects. I
get it, sometimes you need to isolate your gems to keep them compatible. But
there is another player in the field, called bundler. (mentioned down below)

Plus that last bullet, some colleages have mentioned having a 5~6 GB .rvm
folder.

A couple of days ago, I was struggling to track down a gem that I wasn’t sure
where exactly came from, anyway I was about to create a new gemset to do a fresh
start when someone adviced me to check out rbenv.

The rbenv way

A highlight in favor of rbenv is that you don’t actually need to worry about
maintaing your gemsets, since it relays on bundler
who takes care of all your application dependencies. Letting you care about
just the version of the ruby you want to use globally, locally and in a per
project basis. Let’s check out rbenv.

RVM and rbenv aren’t friends 🙁

First of all, you better avoid using both in the same environment because they
are incompatible. Don’t say I didn’t warn you.