Skip to content

Instantly share code, notes, and snippets.

@olistik
Last active August 12, 2021 06:39
Show Gist options
  • Save olistik/2627011 to your computer and use it in GitHub Desktop.
Save olistik/2627011 to your computer and use it in GitHub Desktop.
Ubuntu 12.10 setup (rbenv/RVM, Janus, PostgreSQL)

Ubuntu 12.10 setup (rbenv/RVM, Janus, PostgreSQL)

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

You can use rbenv OR RVM, they're mutually exclusive. Feel free to choose the one that fits your needs.

cd
git clone git://github.com/sstephenson/rbenv.git .rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
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
exec $SHELL

latest ruby (2.0.0-p247)

  • Install the pre-requisites:
sudo apt-get install zlib1g-dev build-essential libssl-dev libreadline-dev
  • Install the interpreter:
rbenv install 2.0.0-p247
rbenv global 2.0.0-p247
ruby -v
  • install the pre-requisites:
sudo apt-get install build-essential openssl libreadline6 libreadline6-dev git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion pkg-config
curl -L https://get.rvm.io | bash -s stable
exec $SHELL
rvm install ruby
rvm use ruby --default
ruby -v
  • Don't require rdoc and ri when installing gems:
echo "gem: --no-ri --no-rdoc" > ~/.gemrc
  • Install the latest rails (4.0.0):
gem i bundler rails

Janus (vim)

sudo apt-get install curl
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
  • rmagick: graphicsmagick-libmagick-dev-compat libmagickwand-dev
sudo -u postgres createuser olistik
sudo -u postgres psql
postgres=# \password olistik
postgres=# create database myapp_development;
CREATE DATABASE
postgres=# grant all privileges on database myapp_development to olistik;
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
Copy link

ghost commented May 11, 2012

Nice writeup! Just did a similar setup this week. People may also find the following to be quite useful:

sudo apt-get install libqt4-dev
sudo apt-get install g++
sudo gem install capybara-webkit

sudo gem install curl
sudo apt-get install libcurl4-gnutls-dev
sudo gem install curb

@Keerthana
Copy link

Thank you! very useful..

@nikoma
Copy link

nikoma commented Sep 9, 2012

Thank you! You just made my day. I so did not feel like setting up a new machine "real quick" and stumbled over your Gist. Very nice from A-Z.

@olistik
Copy link
Author

olistik commented Oct 1, 2012

@bol-masterchief I've updated that section adding your contribution :-)

@rdlugosz
Copy link

Helpful notes, but a linux system is nothing without a good dose of blinkenlights...

sudo apt-get install gkrellm

@intel352
Copy link

intel352 commented Dec 4, 2012

Why install rbenv AND rvm? rbenv specifically states it's incompatible with rvm. source: https://github.com/sstephenson/rbenv

@olistik
Copy link
Author

olistik commented Dec 7, 2012

@intel352: I've mentioned both because when I've created this document I was using rbenv and later I've switched to rvm.
These instructions are just a reference so that if you're going to install one them, you're covered ;-)

@flyingmate
Copy link

Is there any smooth way to install rubygems on rbenv? It seems rvm has but I prefer to use rbenv.. I'm not sure which one is better between apt-get install rubygems and wget rubygems.tgz on ubuntu(I'm using 12.04)

@flyingmate
Copy link

Sorry for my ignorance. I already have gem command except sudo gem because I installed rbenv without sudo.

Thank you for your instruction.

@sharms
Copy link

sharms commented Feb 6, 2013

Thank you for writing this up, I can't tell you how many times I have already used this.

@abimaelmartell
Copy link

you should add curl to the basic pre-requisites :)

@olistik
Copy link
Author

olistik commented Mar 9, 2013

@abimaelmartell It's already present in the RVM section.
BTW I'm going to move it upwards since it's used in the Janus setup :-)

@olistik
Copy link
Author

olistik commented Mar 9, 2013

@sharms: I'm glad to hear it, I simply made it for myself but it turned out to be useful for others too :-)

@abimaelmartell
Copy link

also the latest ruby version is 1.9.3-p392

@scotthelm
Copy link

this is a great writeup. Thanks for posting.

@olistik
Copy link
Author

olistik commented Oct 20, 2013

@abimaelmartell I've updated the version numbering :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment