Appendix A. Installing Ruby on Mac and Linux

Installing on Mac

New Macs ship with Ruby 2.0 already installed, so if you’re here, you’re likely using an older Mac that has Ruby 1.8.7. Not to worry! We’ll get you upgraded in a jiffy.

Open up your terminal and type the following code. (The $ just shows you where to start typing—don’t type the $!) This will install a tool called RVM (Ruby Version Manager) as well as Ruby 2.0.

$ \curl -L https://get.rvm.io | bash -s stable --ruby=2.0.0
--auto-dotfiles

Once you do this, you’ll see a whole bunch of text pop up to tell you that your computer is downloading Ruby. When it’s all done, close your terminal, reopen it, and enter ruby -v. You should see your computer print a response with ruby 2.0.0 in it!

If your ...

Get Ruby Wizardry now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.