2013-03-22 18:06:04 -07:00
|
|
|
#!/usr/bin/env zsh
|
2013-03-06 20:36:17 -08:00
|
|
|
|
2013-03-22 10:15:50 -07:00
|
|
|
if ! command_exists rvm; then
|
2013-03-16 21:28:28 -07:00
|
|
|
# If RVM's not installed, install it and the rubies
|
2013-03-22 10:15:50 -07:00
|
|
|
echo-g "==> Rvm: Installing"
|
2013-03-16 21:16:00 -07:00
|
|
|
|
|
|
|
# https://rvm.io
|
2013-03-21 00:07:56 -07:00
|
|
|
curl -L https://get.rvm.io | bash -s stable --ruby | indent
|
2013-03-16 21:16:00 -07:00
|
|
|
|
2013-03-22 10:15:50 -07:00
|
|
|
echo-g "==> Rvm: Install rubies"
|
2013-03-21 19:26:04 -07:00
|
|
|
# Install rubies and update rubygems
|
2013-03-23 00:45:23 -07:00
|
|
|
rvm install 1.8.7
|
|
|
|
rvm install 2.0.0
|
2013-03-16 21:28:28 -07:00
|
|
|
|
2013-03-23 00:49:19 -07:00
|
|
|
if is_mac; then
|
|
|
|
# But ultimately, the system should be the default
|
|
|
|
rvm --default use system
|
|
|
|
else
|
|
|
|
rvm --default use 2.0.0
|
|
|
|
fi
|
2013-03-16 21:28:28 -07:00
|
|
|
|
2013-03-21 19:26:04 -07:00
|
|
|
# A few prerequisites
|
|
|
|
sudo gem install bluecloth capistrano bundler colorize
|
2013-03-23 00:45:23 -07:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Update it
|
2013-03-16 21:28:28 -07:00
|
|
|
|
2013-03-23 00:45:23 -07:00
|
|
|
# Make sure rvm is sourced properly
|
|
|
|
if [ -f ~/.rvm/scripts/rvm ]; then
|
|
|
|
[ "$(type rvm | grep function)" ] || source ~/.rvm/scripts/rvm
|
2013-03-16 21:28:28 -07:00
|
|
|
fi
|
2013-03-16 21:16:00 -07:00
|
|
|
|
2013-03-23 00:45:23 -07:00
|
|
|
# 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
|
|
|
|
|
2013-03-23 00:49:19 -07:00
|
|
|
# Only mac needs this
|
|
|
|
if is_mac; then
|
|
|
|
# Update system ruby
|
|
|
|
echo-g "==> Rvm: Updating system ruby"
|
|
|
|
rvm use system
|
|
|
|
sudo gem update --system
|
|
|
|
sudo gem update
|
|
|
|
fi
|
2013-03-23 00:45:23 -07:00
|
|
|
|
2013-03-22 10:15:50 -07:00
|
|
|
echo-g "==> Rvm: DONE!"
|