Day 1: Setup

We need tools in order to program. This is where programming starts. Unfortunately, for many people this is where it also ends. I’ve seen people fighting with incompatible versions or programs and giving up. But don’t worry, I went through this process myself. I tried every piece of software and I can tell you that it works for sure. Follow the instructions and you’ll be fine. Ready, get set, go!

Already have Ruby installed ?

Mac OS X and many modern Linux distributions should already have ruby installed. Open up your terminal and type this:

$ ruby -v
$ irb -v

If you see the version of Ruby, you’re good to go. It should look something like this:

ruby 1.9.3p194 (2012-04-20 revision 35410)[x86_64-darwin12.2.0]

If this is the case, go ahead straight to Day 2: Data Types and Variables

If you see “unknown command” error instead, the Ruby is missing on your system. It’s not a big deal. We’ll install Ruby ourselves.

Using Windows?

If you’re on Windows and running a Linux under VirtualBox is not an option, you can still install Ruby using Ruby Installer.

1) Download Ruby Installer

Download Ruby-2.0.0 installer from Ruby Installer download page.

2) Install it

Make sure to check “Add Ruby executables to you PATH” checkbox

Install Ruby on Windows

3) Check your Ruby installation

Open your Command Prompt to see if Ruby was successfully installed. See the instructions from “Already have Ruby installed ?” section for more information. You should see this

Ruby in command prompt on Windows

Using Mac OS X?

Most of modern Macs already have ruby installed. If you have an old Mac with no ruby on it, follow these instructions.

1) Install OS X command line tools

Go to the downloads page of Apple Developer Portal. Register or sign in if you have an account already. Search for “Command Line Tools”. Choose the one for you version of OS X (Mountain Lion, Mavericks, etc), download it and install it.

2) Install Homebrew

$ ruby -e "$(curl -fsSL"

3) Install rbenv

$ brew update
$ brew install rbenv ruby-build
$ echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
$ source ~/.bash_profile

4) Install Ruby

$ rbenv install 2.1.0
$ rbenv global 2.1.0 # set ruby 2.1.0 as a default

5) Install Gems

$ gem install rbenv-rehash bundler

Photo by zzpza