Skip to content

Instantly share code, notes, and snippets.

@griffithac
Forked from georgeredinger/setup.md
Last active October 13, 2015 18:18
Show Gist options
  • Save griffithac/4236871 to your computer and use it in GitHub Desktop.
Save griffithac/4236871 to your computer and use it in GitHub Desktop.
Ruby on Rails development setup on Ubuntu 12.04 (gedit, git, rbenv)

Ruby on Rails production setup on Ubuntu 12.04

System update

# change mirror to ubuntu.osuosl.org 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 "your_email@youremail.com"

Add public key to github then test it out with this

ssh -T git@github.com

Set global git identity

git config --global user.name "John Doe"
git config --global user.email your_email@youremail.com

Set default text editor for git

git config --global core.editor gedit

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://github.com/sstephenson/rbenv.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://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
exec $SHELL

Install some rubies

rbenv install 2.0.0-p0
rbenv rehash

Set a global ruby

rbenv global 2.0.0-p0

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

Postgres setup

sudo apt-get install postgresql libpq-dev
sudo -u postgres createuser --superuser `logname`

Install pdftk from source

download source from http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/

cd
wget http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/pdftk-2.01-src.zip
unzip unzip pdftk-2.01-src.zip
cd cd pdftk-2.01-dist/pdftk
sudo apt-get install gcj-jdk
sudo make -f Makefile.Debian
sudo make -f Makefile.Debian install
sudo ln -nfs /usr/local/bin/pdftk /usr/bin/pdftk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment