Since my script for quickly getting a fresh Ubuntu install ready for Ruby development has gained some popularity, I've decided to maintain it. I've released a minor version of the setup script (version 1.0.1) that checks for things like apt and curl before trying to use them.

Installation

Remember to always read the contents of a script before running it like this:

    wget -q -O - http://goo.gl/q9vdc | bash

Source Code

dev_setup.sh

#!/bin/bash
# Version: 1.0.1
# Author: David Chapman
# Description: A quick script to get a Ubuntu machine up and running.

# The commands we'll be using are here
CURL="curl"
APT="apt-get"

# Checks that the system has apt
if ! $APT -v>/dev/null; then
  echo "You must have apt installed for this script to work."
  exit 1;
fi

# Checks if curl is installed, installs it if not
if ! $CURL --version>/dev/null; then
  echo "Installing curl..."
  sudo $APT install curl -y
fi

# Make sure you do this from time to time:
sudo $APT update && sudo $APT upgrade -y

# Here are the actual packages (feel free to contribute):
sudo $APT install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev nodejs libssl-dev libreadline6-dev libreadline-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev ncurses-term automake libtool bison subversion libcurl4-openssl-dev mysql-client mysql-server postgresql postgresql-contrib imagemagick libmagickwand-dev apache2-mpm-prefork apache2-prefork-dev libapr1-dev libaprutil1-dev redis-server vim -y

# Make default editor vim :)
echo "export EDITOR=vim" >> ~/.bashrc

# Install RVM
$CURL -L https://get.rvm.io | bash -s stable --rails --autolibs=enabled

# Source rvm
source ~/.rvm/scripts/rvm

# Source .bashrc
source ~/.bashrc

# Reload RVM
rvm reload

David Chapman is a Ruby on Rails developer at isotope|eleven with over 5 years development experience. He's currently majoring in Electrical Engineering with a minor in Computer Science at the University of Alabama at Birmingham. David is a Linux geek, a math geek, a physics geek, a serious gamer, and a reader of Reddit. His super power is eating chips and salsa.