#!/bin/zsh if ! command-exists "rvm"; then # If RVM's not installed, install it and the rubies echoh "==> Rvm: Installing" # https://rvm.io curl -L https://get.rvm.io | bash -s stable --ruby | indent echoh "==> Rvm: Install rubies" { # Install rubies and update rubygems rvm install 1.9.3 rvm install 1.8.7-p371 # But ultimately, the system should be the default rvm --default use system # A few prerequisites sudo gem install bluecloth capistrano bundler colorize } | indent else # Otherwise, update it # Make sure rvm is sourced properly if [ -f ~/.rvm/scripts/rvm ]; then [ "$(type rvm | grep function)" ] || source ~/.rvm/scripts/rvm fi # Update all rubies and rubygems for v in 1.9.3 1.8.7; do echoh "==> Rvm: Updating ruby $v" { rvm use $v gem update --system gem update } | indent done # Update system ruby echoh "==> Rvm: Updating system ruby" { rvm use system sudo gem update --system sudo gem update } | indent fi echoh "==> Rvm: DONE!"