2013-03-22 18:06:04 -07:00
|
|
|
#!/usr/bin/env zsh
|
2013-03-06 20:36:17 -08:00
|
|
|
|
2013-03-23 02:19:12 -07:00
|
|
|
export rvm_ignore_dotfiles=yes
|
|
|
|
|
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-10-18 04:03:28 -07:00
|
|
|
echo_g "==> Rvm: Installing"
|
2013-03-16 21:16:00 -07:00
|
|
|
|
|
|
|
# https://rvm.io
|
2013-12-19 06:48:49 -08:00
|
|
|
curl -L https://get.rvm.io | bash -s stable
|
2013-10-21 01:19:32 -07:00
|
|
|
else
|
|
|
|
# Update it
|
2013-03-23 00:45:23 -07:00
|
|
|
|
2013-10-21 01:19:32 -07:00
|
|
|
# Make sure rvm is sourced properly
|
|
|
|
if [ -f ~/.rvm/scripts/rvm ]; then
|
|
|
|
[ "$(type rvm | grep function)" ] || source ~/.rvm/scripts/rvm
|
|
|
|
fi
|
2013-03-16 21:28:28 -07:00
|
|
|
|
2013-10-21 01:19:32 -07:00
|
|
|
# Update RVM
|
|
|
|
echo_g "==> Rvm: Updating"
|
|
|
|
rvm get stable
|
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 all rubies and rubygems
|
2013-10-18 04:03:28 -07:00
|
|
|
echo_g "==> Rvm: Updating rubies"
|
2013-03-23 00:45:23 -07:00
|
|
|
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
|
2013-10-18 04:03:28 -07:00
|
|
|
echo_g "==> Rvm: Updating system ruby"
|
2013-03-23 00:49:19 -07:00
|
|
|
rvm use system
|
|
|
|
sudo gem update --system
|
|
|
|
sudo gem update
|
|
|
|
fi
|
2013-03-23 00:45:23 -07:00
|
|
|
|
2013-10-18 04:03:28 -07:00
|
|
|
echo_g "==> Rvm: DONE!"
|