Start by installing the following software. Each of these are easy one-click installers:
We'll need to install the Command Line Tools from Xcode.
- Open Xcode
- Go to
Xcode > Preferences
in the menu bar. Protip™: On a Mac,⌘,
(command+comma) is a shortcut for the preferences in most applications - Click on the
Downloads
tab. - Locate
Command Line Tools
in the list of Components, and click install.
RVM (Ruby Version Manager) is a system to isolate and install multiple versions of ruby on the same computer. Programming languages evolve quickly, and so do the libraries written in Ruby, and every version will introduce change. One project may be dependent on Ruby 1.9.3 while another may be dependent on the features in Ruby 2.0.0. To avoid conflicts with different versions of ruby and libraries RVM isolates the installations related to each version.
- Open the
Terminal
app. - Type
\curl -L https://get.rvm.io | bash
You will see a bunch of output - Open the file located at
~/.bash_profile
and addsource $HOME/.rvm/scripts/rvm
to the bottom of the file. Protip™: You can use theecho
command in the terminal to append text to a file without opening it.echo "source $HOME/.rvm/scripts/rvm" >> ~/.bash_profile
- To ensure RVM is installed correctly type
type rvm | head -n 1
, if everything is right it should returnrvm is a function
.
Use the rvm
tool to install and use Ruby 2.0.0.
rvm install ruby-2.0.0
- Wait a while... It will take a few minutes
rvm use 2.0.0
- Check the version with
ruby -v
. This should readruby 2.0.0...
- Next open up IRB and give 'er a try.
irb
1 + 1
TODO: RVM Lesson