Long story short
The following are steps we take at Hashrocket when setting up a near perfect Ruby development environment in GNU/Linux (Debian/Ubuntu). Feel free to copy and paste the commands into your terminal.
A Word of Caution
While it is unlikely any instruction given below might damage your system, it’s always a good idea to backup everything before doing any of it, just in case. I am not responsible for anything that may result from following the instructions below. Proceed at your own risk.
Prerequisite Debian/Ubuntu Apps:
- Chrome (+ vimium, make default?)
- Firefox (+ firebug)
Install vim
1 sudo apt-get install vim-gnome
Install utilities
1
2
|
sudo apt-get install curl bison build-essential zlib1g-dev libssl-dev libreadline5-dev libxml2-dev
sudo apt-get install wget ack exuberant-ctags markdown gitk |
get git
1 sudo apt-get install git-core
dotfiles, dev folder
1
2
3
|
mkdir ~/hashrocket
cd ~/hashrocket
git clone http://github.com/hashrocket/dotmatrix.git |
Only do the following line when installing on a pairing station
1
2
3
4
5
6
|
ln -s ~/hashrocket/dotmatrix/.bashrc ~/
ln -s ~/hashrocket/dotmatrix/.hashrc ~/
ln -s ~/hashrocket/dotmatrix/.vim ~/
ln -s ~/hashrocket/dotmatrix/.vimrc ~/
sh ~/hashrocket/dotmatrix/bin/vimbundles.sh |
Install rvm
1
2
3
4
5
6
7
8
9
10
11
12
|
mkdir -p ~/.rvm/src/ && \
cd ~/.rvm/src && \
rm -rf ./rvm/ && \
git clone --depth 1 git://github.com/wayneeseguin/rvm.git && \
cd rvm && \
./install
echo 'if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then source "$HOME/.rvm/scripts/rvm" ; fi' \
>> ~/.bashrc.local
echo 'rvm_project_rvmrc_default=1' \
> ~/.rvmrc # Use default gemset when leaving a .rvmrc project dir
echo '[[ -r $rvm_path/scripts/completion ]] && source $rvm_path/scripts/completion' \
>> ~/.bashrc.local # rvm autocompletion |
Install openssl
1 rvm package install openssl
Install the rubies to your heart’s content
1
2
3
|
rvm install ree -C --enable-shared=yes
rvm install ruby-1.8.7-p248 -C --enable-shared=yes
rvm use 1.8.7-p248 --default |
Setup your .gemrc
1
2
3
4
5
6
7
8
9
10
|
echo -e '---
:benchmark: false
gem: --no-ri --no-rdoc
:update_sources: true
:bulk_threshold: 1000
:verbose: true
:sources:
- http://rubygems.org
- http://gems.github.com
:backtrace: false' > ~/.gemrc |
MySQL
1 sudo apt-get install mysql-common mysql-server-5.0 # Follow instructions
Postgresql
1 sudo apt-get install postgresql-common postgresql-server-dev-8.3 # Follow instructions
Install global gems
1
2
3
|
rvm gemset use global
gem install mysql -- --with-mysql-dir=/usr/local --with-mysql-config=/usr/local/bin/mysql_config
gem install open_gem mongrel pg ruby-debug hitch |
Generate a pubkey for that station
1
2
|
ssh-keygen -t rsa
# Add public key to your github account |