Skip to content

Instantly share code, notes, and snippets.

@kingcons
Last active April 12, 2018 01:40
Show Gist options
  • Save kingcons/1c6248e5eaf22e4eb206 to your computer and use it in GitHub Desktop.
Save kingcons/1c6248e5eaf22e4eb206 to your computer and use it in GitHub Desktop.
Install Party!

Computer Setup

Hey y'all. I want to be sure everyone is ready to roll, so here's are a few things I'd like for you to go ahead and install. Please ask if you have any trouble, or just are curious about why something works the way it does.

After each step, I'll leave a note saying how to check that it was installed properly. Please be sure to run these checks! The most common sorts of errors are commands not completing because your user lacks permission.

If that happens, feel free to flag me down and we'll get it fixed up quick! I'll assume things went smoothly unless I hear otherwise.

Convention Note: Text surrounded by a grey box indicates commands to be run in the terminal.

Xcode Tools

To install the Xcode command line tools, run

xcode-select --install

If running the above command returns an error that the tools are installed already, you're in good shape.

Homebrew

Homebrew is a package manager - that is, a program that helps us manage what other packages are installed. Think of it like a more hackerly version of the app store. :)

Installation notes here

tl;dr: You should just be able to open a Terminal (from Finder->Applications->Utilities) and run:

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

Enter your password when prompted and press Enter.

It is possible you'll encounter some permissions issues here as the recent version of OS X (El Capitan) added something called SIP that affects the user's ability to modify system files. The gory details are here but if you run into this feel free to grab me.

Homebrew Check

brew --version

returns something >= 0.9.

Git

We'll be using Git as our version control/source management tool throughout this class (and almost certainly at your first job as well).

You probably have an existing version on your machine, but

brew install git

to grab a more recent one. Then follow along with Github's "set up git" instructions if you haven't already done so. (I actually prefer the SSH setup over HTTPS, but either is fine.)

You may at some point see some messages like push.default is unset ... it suggests one of two options, but running

git config --global push.default simple

would be a reasonable fix.

Git Check

git --version

returns something >= 2.4 and

git config --global user.name
git config --global user.email

are both set, showing your name and email.

Oh-my-zsh for nicer shell-isms

To make the terminal a more pleasant place to work, we'll switch to zsh for our shell and use a nicer configuration than the default for things like tab completion and so on.

Install [oh-my-zsh][omz] as follows:

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

Note that you will need to quit and restart the terminal after this for the install to take effect.

Oh-my-zsh Check

Running echo $SHELL should return "/bin/zsh".

Rbenv & Ruby

You will eventually need to be able to juggle multiple versions of Ruby on your machine, and it's much easier to set that up now than later. Rbenv is one of several tools that help solve that problem.

(Note: if you've been playing around with ruby on your own and have already installed a different tool for this - like rvm - make sure to remove it first by running rvm implode.)

Install rbenv using these instructions. Note the particular change that is needed for ZSH (to modify ~/.zshrc instead of ~/.bashrc). Then, we'd rather not install different versions of ruby by hand so add ruby-install as shown here.

Once that's done, you should be able to run

rbenv install -l

to list all the available versions of ruby, and

rbenv install 2.3.0

to install the most recent (2.3.0, as of this writing)

Once it's installed (which will take a bit), run

rbenv global 2.3.0

to set that version as the system-wide default.

Finally, run

gem install bundler && gem install pry && rbenv rehash

to add some very useful ruby utilities.

rbenv && ruby-build check

This task is the most complicated to check and debug if steps fail.

type rbenv

should return "rbenv is a shell function" or similar, indicating that rbenv is installed correctly.

which ruby

should return "/Users/your-name-here/.rbenv/shims/ruby", indicating that your shell's $PATH variable is correctly set.

ruby --version

should return 2.3.0.

rbenv is the hardest to debug if it encounters issues. Usually

Finished!

Congrats, we'll be hacking real soon now! :)

.center[woooo]

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