---
title: 'PSA: Do not use system Ruby'
teaser:
tags: web,ruby
author: Joel Oliveira
published_on: 2013-06-28
---

OS X Mavericks may ship with Ruby 2.0. Cool, right? **Don’t touch it.**

## Why eschew system Ruby

The root problem is not with using a pre-installed Ruby per se, but with _not using a Ruby version manager_.

## Problem: Gem Dependencies

PC users will remember [DLL hell](http://en.wikipedia.org/wiki/DLL_Hell). Ruby developers have dealt with similar problems.

Problems regarding gem dependencies are introduced after upgrading `sudo`-installed gems. At this point you are left to shepherd the gems and dependencies of Rubygems on your system’s install. Plain vanilla dependency management of Rubygems is not for the faint of heart, this is why [Bundler](http://gembundler.com) exists. It could be argued that Bundler singlehandedly saved the Ruby ecosystem from this issue. If you don’t plan to use Bundler to manage your Ruby-based app dependencies you will shoot yourself in the foot.

For your Ruby-centric applications use Bundler.

## Problem: Upgrading Ruby

If you’ve run into issues with Ruby and decided to upgrade your system’s runtime you stand the chance of breaking tools that may depend on your old install. Tools like VIM depend on what it was compiled against. Making that update could very well impact the tools that have been built against it.

## Choose an Alternative

Ruby “version managers” will install Ruby and configure your environment for their use.

* [rbenv](https://thoughtbot.com/blog/post/47273164981/using-rbenv-to-manage-rubies-and-gems) is a light-weight solution from [37Signals](http://37signals.com) that we default to in [our laptop setup](https://github.com/thoughtbot/laptop/).
* [Chruby](https://github.com/postmodern/chruby) and [ruby-install](https://github.com/postmodern/ruby-install) ([installation instructions](https://github.com/postmodern/chruby#install)) are the latest option and leave the lightest footprint of the three. Pat Brisbin, a thoughtbot teammate, has a [recent blog post](http://pbrisbin.com/posts/chruby) about chruby that is worth reading.
* [RVM](http://rvm.io/) ([installation instructions](http://rvm.io/rvm/install)), the father of Ruby version managers. Full disclosure - I am a happy user and supporter.

## System Ruby and Rubygems - don’t use them

The amount of uncertainty is too great to build your working environment around the default Ruby-related tools. For the experienced Ruby developer this is nothing new. For the beginner or novice working with Ruby for the first time this might not be quite so obvious. Consider [how many gems still recommend](https://www.google.com/search?q=%22sudo+gem+install%22&oq=%22sudo+gem+install%22&aqs=chrome.0.57j0l3j62l2.3569j0&sourceid=chrome&ie=UTF-8) using `sudo gem install` in their instructions? If your project is one of them, please update it to **not** do so.

<iframe title="The more you know - YouTube" width="420" height="315" src="http://www.youtube.com/embed/v3rhQc666Sg" frameborder="0"></iframe>

_Special thanks to Pat, Gabe, Joël and Dan for contributing to this post._
