Instructions for Mac

Table of contents

Edit this page

Instructions for Mac set up. If you are on Windows, ignore this article and proceed to the next one.

Check the version of your operating system by click the Apple menu and choosing “About this Mac”.

Apple's menu

If your version is 10.6 or higher, this guide is for you. If it’s lower, email us urgently, well before the Day of Code.

MacOS 10.9 and higher

If your version is 10.9 or higher, do the following:

Install Command line tools

Open Terminal (Mac) or the Command Prompt (Windows), and, at the command line, paste the following and press enter:

xcode-select --install

Install Homebrew

At the command line, paste the following and press enter:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Check that Git is installed

Git should be installed as part of XCode, but it’s best to check. At the command line, type the following and press enter:

  git --version

You should see something like:

  git version xx.xx.xx (Apple Git-xx)

If you don’t, download the latest Git for Mac installer and follow the prompts to install Git.

Install rbenv

At the command line, paste the following and press enter:

brew update
brew install rbenv
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
source ~/.bash_profile

Build Ruby with rbenv

At the command line, paste the following and press enter:

rbenv install 2.5.5

If you get an OpenSSL::SSL::SSLError: … : certificate verify failed error, paste the following and press enter:

brew install curl-ca-bundle

And then also paste the following and press enter.

cp /usr/local/opt/curl-ca-bundle/share/ca-bundle.crt `ruby -ropenssl -e 'puts OpenSSL::X509::DEFAULT_CERT_FILE'`

Set default Ruby

At the command line, paste the following and press enter:

rbenv global 2.5.5

Optional: install Ruby on Rails

You do not need Rails for the Day of Code, but if you’d think you’d like to have it on your laptop for continuing your learning after the event, do the following. At the command line, paste the following and press enter:

gem install rails --no-document

MacOS 10.8 and lower

If your MacOS version is 10.6, 10.7, or 10.8, download the RailsInstaller for your version of OS X:

RailsInstaller for 10.7 and 10.8 (325MB)

RailsInstaller for 10.6 (224MB)

Double click the downloaded file and it will unpack it into the current directory. Double click the the newly unpacked RailsInstaller-1.0.4-osx-10.7.app or RailsInstaller-1.0.4-osx-10.6.app and follow the instructions. It will open a README file with Rails Installer OS X at the top. Please ignore the instructions in this file.

Check your environment

At the command line, paste the following and press enter:

ruby -v

You should get something like this appear:

ruby 2.5.5p157 (2019-03-15 revision 67260) [x86_64-darwin17]

Please email us if you don’t.

What you’ve learned

  • You have installed the tools needed to develop software on your computer.