Navigation
« Intersection of collection of arrays | Main | Subdomain routing with rails 3.1 »
Monday
Jun062011

Ubuntu RVM Rails pre install

I have a weird issue where I wipe and re-install operating systems all the time. Because of this, I decided to create a shell script that will install all the prerequisites for rvm, install and configure rvm and then install rails. Currently, it is set to install rails --pre (currently Rails 3.1.rc1).

#!/bin/bash

echo "Installing dependencies"

sudo apt-get install ruby curl bison build-essential autoconf zlib1g-dev libssl-dev libxml2-dev libreadline6-dev git-core subversion sqlite3

echo "Installing RVM"
bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)

echo "Configuring RVM"
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.bashrc
source ~/.bashrc

echo "Installing ruby 1.9.2-head"
rvm install 1.9.2-head

echo "Setting ruby 1.9.2-head as default"
rvm use 1.9.2-head --default

echo "Installing rails pre"
gem install rails --pre --no-ri --no-rdoc

Just run

source ubuntu_rvm_rails.sh

It will ask you for your sudo password and to confirm the installed dependencies.

PrintView Printer Friendly Version

EmailEmail Article to Friend

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
All HTML will be escaped. Textile formatting is allowed.