Skip to content

Instantly share code, notes, and snippets.

@mschae
Forked from tonyc/gist:5989308
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mschae/9876661 to your computer and use it in GitHub Desktop.
Save mschae/9876661 to your computer and use it in GitHub Desktop.
#/usr/bin/env bash
CHRUBY_VERSION=0.3.8
RUBY_INSTALL_VERSION=0.4.1
RUBY_VERSION=2.1.1
set -e
set -x
apt-get update
apt-get upgrade
apt-get -y install build-essential curl git-core openssl libreadline6 libreadline6-dev \
zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev \
libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison libcurl4-openssl-dev \
libpcre3 libpcre3-dev libpq5 libpq-dev
wget -O chruby-$(CHRUBY_VERSION).tar.gz https://github.com/postmodern/chruby/archive/v$(CHRUBY_VERSION).tar.gz
tar -xzvf chruby-$(CHRUBY_VERSION).tar.gz
cd chruby-$(CHRUBY_VERSION)/
make install
cd ..
wget -O ruby-install-$(RUBY_INSTALL_VERSION).tar.gz https://github.com/postmodern/ruby-install/archive/v$(RUBY_INSTALL_VERSION).tar.gz
tar -xzvf ruby-install-$(RUBY_INSTALL_VERSION).tar.gz
cd ruby-install-$(RUBY_INSTALL_VERSION)/
make install
ruby-install -i /usr/local ruby $RUBY_VERSION
echo "source /usr/local/share/chruby/chruby.sh" >> /etc/profile.d/chruby.sh && chmod u+x /etc/profile.d/chruby.sh
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment