1.4. Ruby on Rails 4 on Mac OS X 10.7

Mac OS 10.7 includes Ruby version 1.8.7 as standard. Not interesting for our purposes. We want Ruby 2.0.0 and Rails 4.0. To avoid interfering with the existing Ruby and Rails installation and therefore the packet management of Mac OS X, we install Ruby 2.0.0 and Rails 4.0 with RVM (Ruby Version Manager).
With RVM, you can install and run any number of Ruby and Rails versions as normal user (without root rights and in your home directory). So you can work in parallel on old projects that may still use Ruby 1.9.3 and new projects that use Ruby 2.0.0.

Buy the new Rails 5.1 version of this book.

Detailled information on RVM can be found at the RVM homepage at https://rvm.io/.

Xcode Installation or Upgrade

Before you start installing Ruby on Rails, you must install the latest Apple Xcode tools on your system. The easiest way is via the Mac App Store (search for "xcode") or via the website https://developer.apple.com/xcode/. Please take care to install all the command line tools.

Installing Ruby 2.0.0 and Ruby on Rails 4.0 with RVM

RVM can be installed in various ways. I recommend using the following monster command (please copy it exactly) that installs the latest RVM, Ruby and Ruby on Rails in your home directory:
$ curl -L https://get.rvm.io | bash -s stable --rails
$ source ~/.rvm/scripts/rvm

Thank you for your support and the visibility by linking to this website on Twitter and Facebook. That helps a lot!