Skip to content

Instantly share code, notes, and snippets.

@sposmen
Forked from abimaelmartell/gist:3929229
Created October 29, 2012 12:38
Show Gist options
  • Save sposmen/3973289 to your computer and use it in GitHub Desktop.
Save sposmen/3973289 to your computer and use it in GitHub Desktop.
Ubuntu 12.10 setup (rbenv/rvm, janus, postgres)

Basic pre-requisites

  • Some utilities:
sudo apt-get install vim tmux git curl
  • Copy/paste from the command line:
sudo apt-get install xclip
echo "alias clipboard='xclip -sel clip'" >> ~/.bashrc
(echo "alias clipboard='xclip -sel clip'" >> ~/.zshrc ) //With ZSH

rbenv

cd
git clone git://github.com/sstephenson/rbenv.git .rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
(echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshrc) //With ZSH 

echo 'eval "$(rbenv init -)"' >> ~/.bashrc
(echo 'eval "$(rbenv init -)"' >> ~/.zshrc) //With ZSH

exec $SHELL

ruby-build

mkdir -p ~/.rbenv/plugins
cd ~/.rbenv/plugins
git clone git://github.com/sstephenson/ruby-build.git
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
(echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.zshrc) //With ZSH
exec $SHELL

latest ruby (1.9.3-p194)

  • Install the pre-requisites:
sudo apt-get install zlib1g-dev build-essential libssl-dev libreadline-dev
  • Install the interpreter:
rbenv install 1.9.3-p194
rbenv global 1.9.3-p194
ruby -v
  • Don't require rdoc and ri when installing gems:
echo "gem: --no-ri --no-rdoc" > ~/.gemrc
  • Install the latest rails (3.2.3):
gem i bundler rails

janus (vim)

curl -Lo- http://bit.ly/janus-bootstrap | bash

Git/Github configuration

git config --global color.ui true
git config --global user.name "Maurizio De Magnis"
git config --global user.email "[email protected]"
ssh-keygen -t rsa -C "[email protected]"
cat ~/.ssh/id_rsa.pub | clipboard

System dependencies for peculiar gems

  • nokogiri: libxml2-dev libxslt1-dev
  • pg: postgresql libpq-dev
  • rails related: nodejs
  • mysql: mysql-server mysql-client libmysqlclient-dev
  • sqlite3: sqlite3 libsqlite3-dev
  • capybara-webkit: libqt4-dev g++
  • curb: libcurl4-gnutls-dev

Postgres setup

sudo -u postgres createuser --superuser olistik
sudo -u postgres psql postgres
postgres=# \password olistik

createdb application_development
bundle exec rails dbconsole
# pass

Shared folder setup (virtualbox)

cd
pwd # /home/olistik
mkdir projects
id # uid=1000,gid=1000,...
sudo echo "projects /home/olistik/projects vboxsf uid=1000,gid=1000,rw 0 0" >> /etc/fstab
sudo mount projects
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment