-
-
Save alanstevens/1909971 to your computer and use it in GitHub Desktop.
Shell script to install rvm at the system level.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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