Created
December 11, 2010 04:45
-
-
Save wayneeseguin/737153 to your computer and use it in GitHub Desktop.
RVM bootstrapping script for Jeffa
This file contains 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
#!/bin/bash | |
banner() | |
{ | |
printf ' | |
______________________________________________ | |
| _____ ____ _ _ | | |
| | ____|__ _ ___ _ _ | _ \ __ _(_) |___ | | |
| | _| / _` / __| | | | | |_) / _` | | / __| | | |
| | |__| (_| \__ \ |_| | | _ < (_| | | \__ \ | | |
| |_____\__,_|___/\__, | |_| \_\__,_|_|_|___/ | | |
| |___/ | | |
|_____________________________________________| | |
' | |
} | |
debian() | |
{ | |
apt-get install build-essential bison openssl libreadline5 libreadline5-dev curl git-core zlib1g zlib1g-dev libssl-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libmysqlclient-dev | |
} | |
redshit() | |
{ | |
yum install -y git bison svn autoconf sqlite-devel gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel curl | |
} | |
quit() | |
{ | |
exit 0 | |
} | |
if [[ $(id -u) -ne 0 ]] ; then | |
echo "root privileges is needed for Easy Rails please use either sudo or su for this script!" | |
exit 1 | |
fi | |
clear | |
echo "welcome to" | |
banner | |
if command -v apt-get ; then | |
debian | |
elif command -v yum ; then | |
redshit | |
else | |
echo 'Sorry but only debian and redshit are currently supported.' | |
exit 0 | |
fi | |
echo "Installing RVM to /usr/local/rvm" | |
bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head ) | |
echo '[[ -s "/usr/local/rvm/scripts/rvm" ]] && . "/usr/local/rvm/scripts/rvm" # Load RVM into a shell session *as a function*' >> /etc/profile | |
source /usr/local/rvm/scripts/rvm # Load RVM into the current shell. | |
rvm install 1.8.7,1.9.2 # For Example | |
rvm 1.9.2 --default # Set 1.9.2 as the default | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment