Skip to content

Instantly share code, notes, and snippets.

@newjar
Created July 1, 2017 08:42
Show Gist options
  • Save newjar/484acc42653026058a3fcce56f7861bd to your computer and use it in GitHub Desktop.
Save newjar/484acc42653026058a3fcce56f7861bd to your computer and use it in GitHub Desktop.
rvm installer
#!/bin/bash
echo "RVM Installer for Arch Linux"
echo $'\n==========================='
echo "Update system"
echo $'==========================='
sudo pacman -Syu
echo $'\n==========================='
echo "Install curl"
echo $'==========================='
sudo pacman -S curl
echo $'\n==========================='
echo "Add rvm gpg keys"
echo $'==========================='
gpg --keyserver hkp://pgp.mit.edu --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
echo $'\n==========================='
echo "Install latest stable rvm"
echo $'==========================='
\curl -sSL https://get.rvm.io | bash -s stable
echo $'\n==========================='
echo "Load ~/.profile file"
echo $'==========================='
source ~/.profile
echo "Done"
echo $'\n==========================='
echo "Add rvm script to your shell profile"
echo $'==========================='
printf $'Choose your default shell profile: .bashrc(1) or .zshrc(2)\n'
printf $'Please answer 1 or 2: '
read SHELL
case $SHELL in
1)
echo "[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
" >> ~/.bashrc
;;
2)
echo "[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
" >> ~/.zshrc
;;
*)
esac
echo "Done"
echo $'\n==========================='
echo "Checking rvm"
echo $'==========================='
rvm requirements
echo $'\nDone'
echo $'You can install latest stable of ruby with "rvm install ruby --latest"'
echo $'Or with specific version "rmv install 2.4.1"'
echo $'To use rvm "rvm use current" or "rmv use 2.4.1"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment