Installing Ruby on Rails on OS X with rbenv

I decided to do a full install of OS X when Yosemite came out and that included installing Ruby and Ruby on Rails on my machine again. Over the last couple of years, I’ve switched from rvm to rbenv because it is a lighter weight solution. Here are the steps that I take to install Ruby on Rails on OS X today

  1. Install Homebrew
  2. Install git
    brew install git
  3. Install rbenv and ruby-build
    brew install rbenv ruby-build
  4. Add rbenv to bash so that it loads every time you open a terminal
    echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile
    source ~/.bash_profile
  5. Install the latest version of ruby. At the time of writing this, it’s 2.2.3
    rbenv install 2.2.3
  6. Set the latest version to be the global version
    rbenv global 2.2.3
  7. Run rehash
    rbenv rehash
  8. Install ruby on rails
    gem install rails