Skip to content

Instantly share code, notes, and snippets.

@itsthatguy
Last active August 29, 2015 14:03
Show Gist options
  • Save itsthatguy/eb4270ad8a1591185bf6 to your computer and use it in GitHub Desktop.
Save itsthatguy/eb4270ad8a1591185bf6 to your computer and use it in GitHub Desktop.

Setting up the rubies on Mavericks

Overview

This will take about 30 minutes.

Install Homebrew

First, we need to install Homebrew. Homebrew allows us to install and compile software packages easily from source.

Homebrew comes with a very simple install script. When it asks you to install XCode CommandLine Tools, say yes.

Open Terminal and run the following command:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

Install Ruby

Now that we have Homebrew installed, we can use it to install Ruby.

We're going to use rbenv to install and manage our Ruby versions.

To do this, run the following commands in your Terminal:

brew install rbenv ruby-build

# 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

# Install Ruby 2.0.0-p247 and set it as the default version
rbenv install 2.0.0-p247
rbenv global 2.0.0-p247

ruby -v
# ruby 2.0.0-p247

Configuring Git

We'll be using Git for our version control system so we're going to set it up to match our Github account. If you don't already have a Github account, make sure to register. It will come in handy for the future.

Replace my name and email address in the following steps with the ones you used for your Github account.

ssh-keygen -t rsa -C "youremail@youremail.com"

The next step is to take the newly generated SSH key and add it to your Github account. You want to copy and paste the output of the following command and paste it here.

cat ~/.ssh/id_rsa.pub

Once you've done this, you can check and see if it worked:

ssh -T git@github.com

You should get a message like this:

Hi excid3! You've successfully authenticated, but GitHub does not provide shell access.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment