Skip to content

Setting Up Your Development Environment

Michael Ornellas edited this page Apr 21, 2014 · 2 revisions

OSX

Note: These instructions assume you are running OSX Lion (10.7.x) or higher, please consult with an instructor if you have OSX Snow Leopard (10.6.x) or earlier. If you don't know what version of OSX you have installed, click the Apple icon in the top-left corner of the screen and then click "About This Mac", you'll see the OSX version listed there.

Step 0: Update your software

Update all your software by opening up the App Store through the Applications folder found in the Finder and going to the Update tab.

Step 1: Install Developer Tools

First, we will need the XCode developer tools which will be necessary to install software using the homebrew package manager, which we will be installing in a moment. To check if you already have the developer tools installed, open up your Terminal app (it can be found in Applications/Utilities in the Finder menu at the top of the screen) and type gcc followed by hitting the return key on your keyboard.

If you already have the developer tools installed, you will see clang: error: no input files and this means you can safely skip ahead to the next section of this guide titled "Installing Homebrew". If you instead see gcc: command not found, you don't have the developer tools installed and should continue reading this section.

OSX 10.9 Mavericks: Installing Developer Tools

If you saw command not found when you typed gcc into your terminal prompt, you'll need to run the following command to install the Developer Tools:

xcode-select --install

This should pop up a dialog box and instructions for how to install the developer tools. Once complete, skip ahead to the section of this tutorial titled "Installing Homebrew".

If you saw an error message that says "Can't install the software because it is not currently available from the Software Update server", ignore this message since it can be misleading and try running gcc in the terminal again to see if it now says clang: error: no input files. If it does, skip ahead to the section titled "Installing Homebrew".

If running xcode-select --install fails for any other reasons, you can try going to this site and, after logging in with your Apple ID (it is the same as your iTunes or iPhone account if you have already have one), you will be presented with a list of downloads for developers. In the search bar on the left hand side of the screen, type in "command line", hit enter, and then select the latest Command Line Tools for OSX Mavericks.

Note: If all methods of installing the Developer Tools fail to work, consult an instructor.

After you have the Command Line Tools installed, open a terminal and type in gcc once again.

It should now prompt you to agree to the license agreement, type 'agree' and hit enter to continue.

Once you're done with this step, skip down to "Installing Homebrew".

OSX 10.8 and 10.7: Installing Developer Tools

First, you'll need the developer tools. You can download this at home by going to this site and, after logging in with your Apple ID and filling out the subsequent forms, you will be presented with a list of downloads for developers. In the search bar on the left hand side of the screen, type in "command line", hit enter, and then select the latest Command Line Tools for OSX Mountain Lion (replace Mountain Lion with Lion if you're using that version).

After you have the Command Line Tools installed, open a terminal and type the following:

gcc

It should prompt you to agree to the license agreement, type 'agree' and hit enter to continue.

If this method of installing the Developer Tools fail to work, consult an instructor.

Step 2: Installing Homebrew

Next, we'll install Homebrew, a package manager for OSX. This will help us install and maintain command line applications we'll be using throughout the class, like Git.

You can check if you already have Homebrew installed by running the brew command in your terminal, if it says something like command not found, you'll need to install it now.

Run this command in your terminal to install Homebrew:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

Once that command finishes, run brew doctor and ensure that nothing comes up (if stuff does, don't panic. Google the problem and try to solve it based on Stack Overflow answers or GitHub discussions, if that doesn't work, consult an instructor).

Follow this up by installing the latest versions of Git and Zsh, then adding Zsh to the list of shells:

brew update
brew install git
brew install zsh

Then close your terminal window and open a new one and run the following command:

echo '/usr/local/bin/zsh' | sudo tee -a /etc/shells

Close your current terminal window and open a new one now.

Step 3: Installing Oh-My-Zsh and setting up your terminal

Now, we'll run the following command to install Oh-My-Zsh, a package of themes and plugins for our terminal:

curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh

Close your terminal window and open another, things should look a little different if everything went well. If everything looks the same, grab an instructor.

Step 4: Downloading your configuration files (dotfiles)

curl -fsSL https://raw.github.com/makersquare/osx-dotfiles/master/dotfiles.sh | sh

git config --global user.name "Firstname Lastname"
git config --global user.email name@example.com

Close your terminal window and open a new one at this time.

Step 5: Installing Other Software

Run these commands now, one after another. This may take a little while to go through, some of the files are around 100MB.

Note: If any portion of this fails, you can always install these pieces of software by Googling the names of each piece of software and installing manually. You can always consult with an instructor if you need help.

brew tap phinze/cask
brew install brew-cask
brew cask install google-chrome
brew cask install virtualbox
brew cask install vagrant
brew cask install iterm2
brew cask install heroku-toolbelt
brew tap caskroom/versions
brew cask install sublime-text3

Close the Terminal Application now and instead open iTerm by opening it from your Applications folder (found in the Finder). You'll want to use iTerm over Terminal from here on out for the class, I'd advise you to add it to your OSX Dock.

Step 6: Setting up your Sublime Text Settings

Open up Sublime Text by running subl inside of iTerm. Inside of Sublime Text, go to the menu Sublime Text>Preferences>Settings - User and replace the default rules with our versions instead:

{
  "ensure_newline_at_eof_on_save": true,
  "ignored_packages": ["Vintage"],
  "tab_size": 2,
  "translate_tabs_to_spaces": true,
  "trim_trailing_white_space_on_save": true,
  "highlight_line": true,
  "save_on_focus_lost": true,
  "file_exclude_patterns":
  [
    ".DS_Store"
  ],
  "folder_exclude_patterns":
  [
    ".bundle",
    ".git",
    ".sass-cache",
    "vendor/bundle/gems"
  ]
}

Save this file and close Sublime Text.

Step 7: Installing a Powerline Font

Lastly, you'll want to download this font here, browse to where you downloaded it and double click it, followed by tapping "install font". You'll then want to open up iTerm2 (in your applications folder) and go to the "iTerm" menu item at the top of the screen, click it, and open the "Preferences" window. Inside "Preferences", select "Profiles" at the top of the window, and then click the "Text" subheading. Where it says Regular Font and Non-ASCII Font, change both to "Meslo LG M DZ Regular for Powerline", size 14 (or whatever size you're comfortable with).

Ubuntu x64

If you're using Ubuntu 13.04, 13.10, or 14.04 run these commands:

sudo apt-get update
sudo apt-get install software-properties-common

If you're running Ubuntu 12.10 or earlier, run these commands:

sudo apt-get update
sudo apt-get install python-software-properties

After that, all versions of Ubuntu, run the following:

sudo add-apt-repository ppa:git-core/ppa-name
sudo apt-get install git-core
sudo apt-get install zsh
curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh
sudo apt-get install nfs-common
git config --global user.name "Firstname Lastname"
git config --global user.email name@example.com

You'll need to install VirtualBox and Vagrant as well.

You'll also need Sublime Text and Google Chrome.

Windows

Because certain tools are near-impossible to install on Windows machines, we will NOT be supporting computers with Windows in class. Your best option is to either buy a Mac, or, if you're more adventurous and consider yourself decently self-sufficient, dual-booting Linux (Ubuntu if you don't yet have a preference). If you want to dual-boot, you can find some instructions here but just beware that you will be on your own if things go awry since most of our instructors are not intimately familiar with dual-boot setups.