Skip to content

Instantly share code, notes, and snippets.

@alanstevens
Forked from tsykoduk/rvm_systemizer_setup.sh
Last active October 1, 2015 03:18
Show Gist options
  • Save alanstevens/1909971 to your computer and use it in GitHub Desktop.
Save alanstevens/1909971 to your computer and use it in GitHub Desktop.
Shell script to install rvm at the system level.
#!/usr/bin/env bash
#
# execute with:
# curl https://gist.github.com/alanstevens/1909971/raw/install_system_rvm.sh|bash
#
echo "You will be prompted for your password by sudo."
# clear any previous sudo permission
sudo -k
user_name=$(whoami)
# run inside sudo
sudo bash <<SCRIPT
#
# Configure system level gem settings.
#
echo "Disabling ri & rdoc system wide for gem installations and upgrades."
echo "install: --no-rdoc --no-ri" >> /etc/gemrc
echo "update: --no-rdoc --no-ri" >> /etc/gemrc
#
# Install rvm at the system level.
#
\curl https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer | bash -s stable --autolibs=3
#
# add the current user to the rvm group to manage system rubies
#
usermod -aG rvm $user_name
#
# source rvm in the current shell session
#
source /etc/profile.d/rvm.sh
#
# Install Ruby and set system defaults
#
rvm install 1.9.3
rvm use 1.9.3 --default
gem update --system
rvm use 1.9.3@global
gem install bundler
gem install rake
SCRIPT
echo "#"
echo "# $(whoami),"
echo "# In order to use rvm, you must logout - login again."
echo "#"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment