# Download and install RVM
bash < <(curl http://rvm.beginrescueend.com/releases/rvm-install-head)
mkdir -p ~/.rvm/src/ && cd ~/.rvm/src && rm -rf ./rvm/ && git clone --depth 1 http://github.com/wayneeseguin/rvm.git && cd rvm && ./install
#Install the rubies with readline patch
rvm package install readline
rvm package install openssl
rvm package install iconv
rvm install 1.9.2 --with-readline-dir=$HOME/.rvm/usr --with-iconv-dir=$HOME/.rvm/usr --with-openssl-dir=$HOME/.rvm/usr
# Set the default ruby version
rvm --default 1.9.2
# Add to .bashrc the following lines:
# at the top of the file...
if [ -z "$PS1" ]; then
# at the bottom of the file...
fi
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # This loads RVM into a shell session.
[[ -r $rvm_path/scripts/completion ]] && . $rvm_path/scripts/completion
PS1="\$(~/.rvm/bin/rvm-prompt v g s)> $PS1"
# Create a gemset for an application
rvm use 1.9.2
rvm gemset create 'ApplicationName'
rvm use 1.9.2@ApplicationName
# To create a new Rails 3 application
gem install rails
rails new applicationname
# Inside the Rails 3 application, do this to trust the gems and rubies
echo "rvm 1.9.2@ApplicationName" > .rvmrc
# Install bundler which will install all the gems in Gemfile
gem install bundler
bundle install
