Skip to content

Instantly share code, notes, and snippets.

@rob-murray
Last active November 1, 2017 12:46
Show Gist options
  • Save rob-murray/85e8b53610d7027ca3dff9fc3c3dacbe to your computer and use it in GitHub Desktop.
Save rob-murray/85e8b53610d7027ca3dff9fc3c3dacbe to your computer and use it in GitHub Desktop.
Install Ruby

How to install Ruby

MacOS

MacOS High Sierra has Ruby 2.3 installed and El Capitan has Ruby 2.0 - both these should be sufficient for most exercises, but if you would like to install a different version or have an older operating system then follow the instructions below.

Note: these instructions may vary between laptops depending on existing configuration.

  1. Install Xcode command line tools / accept licence

Run xcodebuild -license accept and xcodebuild -license accept to ensure prerequisite tools are present

  1. Open Terminal (Applications->Utilities->Terminal)

  2. Install Homebrew - package management, makes installing Ruby and any subsequent applications easy

Visit Homebrew Copy and paste the line of code into terminal window and hit return

  1. Install Ruby

After the Homebrew installation is complete and successful, install Ruby by typing the following into the terminal window and pressing return

brew install ruby

  1. Test

Test the Ruby installation by typing these lines into the terminal window and pressing return.

Display the Ruby version:

ruby -v

Print a "hello world" message

ruby -e 'puts "hello world!"'

Problems

TBC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment