---
title: Laptop Setup for an Awesome Development Environment
teaser: Don't manually setup your new laptop with a series of copy-and-pasted steps
  from some blog post. Leverage automation and the open source community to save time
  and get a more stable result.
tags: web,open source,ruby,rails,unix,osx
author: Dan Croak
published_on: 2014-06-18
---

We've published guides in [2009], [2011], and [2012] for setting up your macOS
laptop as a Ruby on Rails development machine. Many others have published and
shared similar tutorials.

[2009]: https://thoughtbot.com/blog/2009-rubyists-guide-to-a-mac-os-x-development
[2011]: https://thoughtbot.com/blog/2011-rubyists-guide-to-a-mac-os-x-development
[2012]: https://thoughtbot.com/blog/the-hitchhikers-guide-to-riding-a-mountain-lion

Instead of copying and pasting a series of steps from a blog post, a better
approach is to leverage automation and the open source community to save time
and get a more stable result.

For the past three years, we've been developing and maintaining [Laptop], a
shell script which turns a macOS laptop into an awesome development machine.

[Laptop]: https://github.com/thoughtbot/laptop

## macOS

After setting up the prerequisites described in [the project's README][README],
we run one line:

[README]: https://github.com/thoughtbot/laptop/blob/master/README.md

    bash <(curl -s https://raw.githubusercontent.com/thoughtbot/laptop/master/mac)

## How it works

The script should take less than 15 minutes to install (depends on the machine).

The script is short and is intended to be human-readable
so that we know exactly what is installed and idempotent in case an error
requires the script to be run two or more times.

## What it sets up

Laptop currently sets up these common components:

* Zsh for the Unix shell
* A systems package manager (Aptitude or Homebrew)
* A Ruby version manager (rbenv)
* A Ruby installer (ruby-build)
* The latest stable version of Ruby
* A Ruby package manager (Bundler)
* A JavaScript package manager (NPM)
* Our most commonly-needed databases (Postgres and Redis)
* ImageMagick for cropping and resizing images
* Qt for headless JavaScript testing via Capybara Webkit
* A fuzzy finder (The Silver Searcher)
* A terminal multiplexer (tmux)
* A dotfile manager (rcm)
* CLIs for interacting with GitHub and Heroku

## Extending the script

Individuals can add their own customizations in `~/.laptop.local`. An example
`~/.laptop.local` might look like this:

    #!/bin/sh

    brew tap caskroom/cask
    brew install brew-cask

    brew cask install dropbox
    brew cask install google-chrome
    brew cask install rdio

The `~/.laptop.local` script can take advantage of [the preparation the Laptop
script does][prep], such as its shared functions and exit trap, to provide
better script output and aid debugging.

[prep]: https://github.com/thoughtbot/laptop/tree/master/common-components

## What's next

After using Laptop to set up a development machine, a great next step is to use
[thoughtbot/dotfiles][dotfiles] to configure Vim, Zsh, Git, and Tmux with
well-tested settings that we've evolved since 2011.

[dotfiles]: https://github.com/thoughtbot/dotfiles

Our dotfiles use the same `~/*.local` convention as the Laptop script in order
to [manage team and personal dotfiles together with rcm][rcm].

[rcm]: https://thoughtbot.com/blog/manage-team-and-personal-dotfiles-together-with-rcm

_Note: The original version of the Laptop script supported Linux, and that was
described in this post. In 2014, we [removed support for Linux]. This post was
edited to remove the Linux references, to avoid confusion._

[removed support for Linux]: https://github.com/thoughtbot/laptop/commit/91048f3f96f0d2d14c1106f746dd51c417a26e30
