Installing Ruby - Computer Science Programming Basics in Ruby (2013)

Computer Science Programming Basics in Ruby (2013)

Appendix B. Installing Ruby

This book uses the Ruby programming language to demonstrate code. It is expected that the student learn how to develop programs in Ruby. To accomplish such, the Ruby language must be installed.

To install Ruby on your computer, follow the instructions that correspond to your operating system (Windows, Mac, or Linux).

B.1 Windows

1. Open a web browser and go to the Ruby Installer.

2. Click the Download button on the main page.

3. Click the top file under RubyInstallers and save the file to the desktop.

4. Double-click the file on the desktop and follow the instructions to install Ruby. irb will automatically be installed with the package, as will the rdocs.

B.2 Linux

Debian/Ubuntu: $ sudo apt-get install ruby1.9.1-full

Gentoo: $ emerge ruby irb rdoc

Slackware: Download the source code and follow the instructions in the tar.gz file.

B.3 Mac OS X

Ruby is installed by default in Mac OS X. However, we recommend that you update to a later version of Ruby 1.9 by using the One-Click install.