If you don't already have an account for the Mac App Store, follow the instructions on Apple Support to create a Mac App Store account.
Before class starts, we suggest you upgrade your operating system to OS X Yosemite (10.10), OS X El Capitan (10.11), or macOS Sierra. If you're on an older machine with 4GB or less of memory, please stick to OS X Yosemite. Also, if Apple releases a newer version of macOS while you're in WDI; please don't update until your instructors say it's ok.
To check which operating system you're running:
- Click the apple icon in the top left of your computer screen.
- Select "About This Mac" from the dropdown menu.
- Read the version information from the window that pops up.
If you are not using OS X Yosemite (10.10), OS X El Capitan (10.11), or macOS Sierra, detailed instructions for upgrading your operating system are available through Apple support: How to upgrade to macOS Sierra
Please let an instructor know if you're using an older version of OS X or if your system has less than 2 GB of memory.
- Open the Terminal application.
- In your Terminal, type
xcode-select --install
, and a new window and installer will appear. - Follow the instructions in the installer.
Only follow these steps if you were not able to install Xcode Command Line Tools with the instructions above. If you must run an older version of OS X, you will need to install Command Line Tools that come from Xcode.
- Open the Mac App Store and install Xcode.
- Open Xcode.
- Inside the Xcode menu, choose Preferences > Downloads > Install The Command Line Tools.
- Follow the instructions in the installer.
Note: when copying the code snippets, please exclude the $
as you paste and run the code into your terminal. The dollar sign $
is simply an indicator of the logged-in user in examples.
Homebrew is a package manager - it downloads and updates programs on your machine. We'll use it to quickly download and install other tools we need, or to update already installed tools.
-
Open the Terminal application, and run
which brew
to check if you have Homebrew installed already. Thewhich
Terminal command shows where on your computer a program is installed. If it is installed, the Terminal will output a file path. If it is not installed, the Terminal won't output anything. -
Only if you do not have Homebrew installed, run the command below to install Homebrew. Wait while Homebrew downloads and installs.
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
If you run into problems, you may need to run
rm -rf /usr/local/Cellar /usr/local/.git
and then retry the command above. -
Run
brew update
to update Homebrew. -
Run
brew doctor
in your Terminal to check that Homebrew and any current packages are installed correctly. If there are issues,brew doctor
will list suggestions for how to fix them. Follow these suggestions one by one. If you're not sure what to do, ask! -
Based on the errors in the step above, you may need to edit your
~/.bash_profile
to include the path to Homebrew ifbrew doctor
shows warnings. If in doubt ask for help here.$ echo 'export PATH="/usr/local/bin:/usr/local/sbin:~/bin:$PATH"' >> ~/.bash_profile
-
Let's install our first package with Homebrew,
tree
! This package adds a command to your Terminal that displays files in a tree view (instead of a list view likels
). Enter the following command in your Terminal:
$ tree
It will tell you that this command is not found or it just won't do anything. This is because it's not a program (command) that's installed on your machine. Now install it with this command:
$ brew install tree
- Now run the Terminal command
tree
to see a tree view of all the files inside your current directory!
If you run
tree
from your root directory, it might be printing files for a LONG time! Remember that you can always usectrl + C
in the terminal to stop the currently running process.
-
trash
is another Homebrew package that easily allows one to move files or folders into the trash bin from the terminal. This is good practice because other commands may be more dangerious. Again, thetrash
tool does not permanently delete files or folders, but simply places them in the trash. Let's install it using homebrew with the command:$ brew install trash
We can test this by creating a file and moving our dummy file into our trash bin. Run these lines in your terminal to see the power of
trash
:$ touch new-trash-file.txt $ ls
You should see the newly created file.
$ trash new-trash-file.txt $ ls
Now it's moved to the trash bin!
If you haven't done anything to personalize the terminal yet that's fine, but it will probably look a little boring (and hard to read). We recommend adding some styles to the bash shell. Solarized is a great theme for this purpose.
- Download the zip file of all the themes.
- Unzip it by double-clicking
- Open your the Terminal Application and navigate to
Terminal
->Preferences
. Navigate to theProfiles
tab. In the bottom left hand corner, find the icon that looks like a cog/gear and selectImport...
. - Navigate to the unzipped solarized directory and navigate into the sub-directory
osx-terminal.app-colors-solarized
and selectSolarized Dark ansi.terminal
. - Finally, click the button
Default
next to the cog/gear icon, which will set this to your default theme.
Try opening up a new window for the Terminal and ensure the color scheme has been updated.
Let's change a setting in the Terminal that will allow us to move through and delete entire words at a time by holding down the option
key. This the default behavior of most text editors and will allow us to make more productive edits to our bash commands.
- Navigate back to
Terminal
->Preferences
. - Navigate to the the sub-tab,
Keyboard
- Check the input, at the bottom, that displays "Use Option as Meta key".
Try typing something in the Terminal then using the arrows to navigate through the text; now hold the option
key at the same time to see the cursor jump from one word to the next.
In more recent models of Apple computers, the trackpad produces an artifical "click" sound; however, we can turn this off.
- Navigate to
System Preferences
and clickTrackpad
. - Navigate to the tab
Point & Click
. - At the bottom, check the input that displays "Silent clicking". (If you don't see this option, then you don't need to do this step!)
Ensure the trackpad no longer makes a noise when clicked.
You should already have git installed and have an account on GitHub from Fundamentals. If not, sign up for an account on github.com. We'll be using GitHub to track code changes and collaborate on projects.
-
To check whether git is installed on your system, run the Terminal command
which git
. The output should be a directory path like/usr/bin/git
. This is where git is installed on your machine. If you don't see any output, git is not installed on your computer. -
Only if you do not have git installed, run the following command in your Terminal:
$ brew install git
Configuring your git settings will help GitHub track your contributions and to make it easier and smoother to commit changes.
-
Use the following three
git config
commands to configure your git user information and have git "cache" (remember) it. We use the--global
(or-g
) option to make the configuration apply to all repositories.$ git config --global user.name "YOUR_GITHUB_USERNAME" $ git config --global user.email "YOUR_GITHUB_EMAIL_ADDRESS" $ git config --global credential.helper cache
-
Generate a SSH key for GitHub by following GitHub's instructions. This will allow you to use GitHub from your Terminal without entering your login information every time you push.
Clarifying notes for GitHub's instructions that might be confusing:
-
When you are "Adding a new SSH key to your GitHub Account" the command:
$ pbcopy < ~/.ssh/id_rsa.pub
will take your SSH key that was saved to the file id_rsa.pub and copy it to your clipboard (similar to using Command-C, but with the command line).
- Set up your Node.js environment
- Set up your Ruby environment
- Install Development Tools