#!/usr/bin/env zsh if ! command_exists rvm; then # If RVM's not installed, install it and the rubies echo-g "==> Rvm: Installing" # https://rvm.io curl -L https://get.rvm.io | bash -s stable --ruby | indent echo-g "==> Rvm: Install rubies" # Install rubies and update rubygems rvm install 1.8.7 rvm install 2.0.0 # But ultimately, the system should be the default rvm --default use system # A few prerequisites sudo gem install bluecloth capistrano bundler colorize fi # Update it # Make sure rvm is sourced properly if [ -f ~/.rvm/scripts/rvm ]; then [ "$(type rvm | grep function)" ] || source ~/.rvm/scripts/rvm fi # Update RVM echo-g "==> Rvm: Updating" rvm get stable # Update all rubies and rubygems echo-g "==> Rvm: Updating rubies" rvm all do gem update --system rvm all do gem update # Update system ruby echo-g "==> Rvm: Updating system ruby" rvm use system sudo gem update --system sudo gem update echo-g "==> Rvm: Cleaning up" rvm cleanup all echo-g "==> Rvm: DONE!"