Installing Ruby
Introduction
In order to run Ruby code you need to install a Ruby interpreter.
Installing a Ruby interpreter for Windows is straightforward, but for Mac and Linux it is slightly more complicated. The default Ruby interpreters normally supplied on Mac and Linux are not adequate for running Watir and related Ruby technologies without making significant alterations to them.
There are different options for properly maintaining a Ruby interpreter, but we have chosen rbenv as the most suitable Ruby interpreter for Mac and chruby for Linux.
Note that RVM is an acceptable (if more complicated) way to maintain a Ruby interpreter if you prefer to use it, but if you choose to use rbenv or chruby, be sure to uninstall RVM completely.
Windows
- Download and install the latest version from rubyinstaller
Mac
Hold down the Command key and press the spacebar to open Spotlight search Type Terminal and hit enter
Install XCode command-line tools
Copy and paste this into the terminal and hit enter:
Install HomeBrew
Copy and paste this into the terminal and hit enter:
Install rbenv
Copy and paste this into the terminal:
Copy and paste this into the terminal (update version to latest release if desired):
Linux
Install git Copy and paste this into the terminal:
Install ruby-install Copy and paste this into the terminal:
Install chruby Copy and paste this into the terminal:
Copy and paste this into the bash_profile file that opened in TextEdit:
Save file and Close TextEdit
Copy and paste this into the terminal and hit enter: