2013-03-21 00:07:56 -07:00
|
|
|
#!/bin/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
|
|
|
|
rvm install 1.9.3
|
|
|
|
rvm install 1.8.7-p371
|
2013-03-16 21:28:28 -07:00
|
|
|
|
2013-03-21 19:26:04 -07:00
|
|
|
# But ultimately, the system should be the default
|
|
|
|
rvm --default use system
|
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-16 21:28:28 -07:00
|
|
|
|
|
|
|
else
|
|
|
|
# Otherwise, update it
|
|
|
|
|
|
|
|
# Make sure rvm is sourced properly
|
|
|
|
if [ -f ~/.rvm/scripts/rvm ]; then
|
2013-03-21 00:07:56 -07:00
|
|
|
[ "$(type rvm | grep function)" ] || source ~/.rvm/scripts/rvm
|
2013-03-16 21:28:28 -07:00
|
|
|
fi
|
|
|
|
|
2013-03-21 00:07:56 -07:00
|
|
|
# Update all rubies and rubygems
|
|
|
|
for v in 1.9.3 1.8.7; do
|
2013-03-22 10:15:50 -07:00
|
|
|
echo-g "==> Rvm: Updating ruby $v"
|
2013-03-21 19:26:04 -07:00
|
|
|
rvm use $v
|
|
|
|
gem update --system
|
|
|
|
gem update
|
2013-03-21 00:07:56 -07:00
|
|
|
done
|
2013-03-16 21:28:28 -07:00
|
|
|
|
|
|
|
# Update system ruby
|
2013-03-22 10:15:50 -07:00
|
|
|
echo-g "==> Rvm: Updating system ruby"
|
2013-03-21 19:26:04 -07:00
|
|
|
rvm use system
|
|
|
|
sudo gem update --system
|
|
|
|
sudo gem update
|
2013-03-16 21:28:28 -07:00
|
|
|
fi
|
2013-03-16 21:16:00 -07:00
|
|
|
|
2013-03-22 10:15:50 -07:00
|
|
|
echo-g "==> Rvm: DONE!"
|