Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Ruby on Rails development setup on Ubuntu 12.04 (vim, git, rbenv)

Ruby on Rails development setup on Ubuntu 12.04

System update

# change mirror to first
sudo apt-get update

Install common libraries

sudo apt-get install build-essential libreadline-dev libssl-dev zlib1g-dev libxml2-dev libxslt-dev

Install all the things

sudo apt-get install vim git-core gitg tmux

Generate SSH keys

ssh-keygen -t rsa -C ""

Add public key to github then test it out with this

ssh -T

Set global git identity

git config --global "John Doe"
git config --global

Set default text editor for git

git config --global core.editor vim

Set git status colors

git config --global color.diff auto
git config --global color.status auto
git config --global color.branch auto
git config --global color.status.changed yellow
git config --global color.status.added green
git config --global color.status.untracked red

Verify git settings

git config --list

Install rbenv

git clone git:// ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
exec $SHELL

Install ruby-build

mkdir ~/.rbenv/plugins
git clone git:// ~/.rbenv/plugins/ruby-build
exec $SHELL

Install some rubies

rbenv install 1.9.2-p320
rbenv install 1.9.3-p194
rbenv rehash

Set a global ruby

rbenv global 1.9.2-p320

Turn off rdoc generation when installing/updating gems

echo "install: --no-ri --no-rdoc" >> ~/.gemrc
echo "update: --no-ri --no-rdoc" >> ~/.gemrc

Install javascript runtime for rails projects

sudo apt-get install nodejs

Set global bundler gem install path

# from within a project with a Gemfile
bundle config path .bundle/gems

Databases and libraries

  • Postgres
sudo apt-get install postgresql libpq-dev
sudo -u postgres createuser --superuser `logname`
  • MySQL
sudo apt-get install mysql-server mysql-client libmysqlclient-dev
  • Sqlite3
sudo apt-get install sqlite3 libsqlite3-dev

This comment has been minimized.

Copy link

@dinnouti dinnouti commented Apr 15, 2013

great gist, quick note, it is missing gem install bundler


This comment has been minimized.

Copy link

@jk121960 jk121960 commented Apr 20, 2013

bundler is included in rails

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.