helm/install/rvm

52 lines
1 KiB
Plaintext
Raw Normal View History

2013-03-06 20:36:17 -08:00
#!/bin/bash
2013-03-16 21:16:00 -07:00
echo "[RVM]"
if [ ! `command -v "rvm"` ]; then
# If RVM's not installed, install it and the rubies
2013-03-16 23:30:13 -07:00
echo
echo "* Installing RVM"
2013-03-16 21:16:00 -07:00
# https://rvm.io
curl -L https://get.rvm.io | bash -s stable --ruby
2013-03-16 23:30:13 -07:00
echo
echo "* 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
else
# Otherwise, update it
# Make sure rvm is sourced properly
if [ -f ~/.rvm/scripts/rvm ]; then
[[ "$(type rvm)" =~ "function$" ]] || source ~/.rvm/scripts/rvm
fi
# Update all rubies and rubygems
for v in 1.9.3 1.8.7; do
2013-03-16 23:30:13 -07:00
echo
echo "* Updating ruby $v"
rvm use $v
gem update --system
gem update
done
# Update system ruby
2013-03-16 23:30:13 -07:00
echo
echo "* Updating system ruby"
rvm use system
sudo gem update --system
sudo gem update
fi
2013-03-16 21:16:00 -07:00
2013-03-16 23:30:13 -07:00
echo
echo "Done!"