Created
February 17, 2011 05:26
-
-
Save tgittos/831039 to your computer and use it in GitHub Desktop.
Install the basics for running Ruby on Rails apps via rvm, nginx and clustered thin servers
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 | |
# Check we are root first | |
if [[ ! "root" = "$(whoami)" ]] ; then | |
echo -e "Please re-run as root." && exit 1 | |
fi ; clear | |
# RVM dependencies | |
echo -e "Installing build essential and required dependencies" | |
sudo apt-get install -y build-essential libreadline5-dev libssl-dev bison libz-dev zlib1g zlib1g-dev libxml2 libxml2-dev libxslt-dev libssl-dev openssl libreadline-dev g++ | |
# Rails deploy stuff | |
echo -e "Installing Rails specific hosting dependencies" | |
sudo apt-get install -y nginx sqlite3 libsqlite3-dev curl git-core | |
# System wide RVM | |
echo -e "Installing RVM system wide" | |
#bash < <( curl -L http://bit.ly/rvm-install-system-wide ) | |
bash < <( curl -L https://github.com/wayneeseguin/rvm/raw/1.3.0/contrib/install-system-wide ) | |
# Modify the ~/.bashrc | |
echo '[[ -s "/usr/local/lib/rvm" ]] && . "/usr/local/lib/rvm"' >> ~/.bashrc | |
source ~/.bashrc | |
# Add group write permissions on the RVM folder | |
sudo chmod g+w /usr/local/rvm -R | |
# Make no-ri and no-rdoc default | |
echo "install: --no-ri --no-rdoc\nupdate: --no-ri --no-rdoc" | sudo tee -a /etc/gemrc | |
cat<<-Message | |
rvm has been installed system wide | |
Be sure to add any users using rvm to the rvm group with | |
usermod -aG rvm <username> | |
You can install rubies with the following commands: | |
rvm install 1.8.6 | |
rvm install 1.8.7 | |
rvm install ree | |
rvm install 1.9.2 | |
You can then set the default system wide ruby using | |
rvm use <version> --default | |
Message |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment