Skip to content

Instantly share code, notes, and snippets.

@vifo
Created September 26, 2012 09:05
Show Gist options
  • Save vifo/3786925 to your computer and use it in GitHub Desktop.
Save vifo/3786925 to your computer and use it in GitHub Desktop.
Ruby: Install Ruby 1.9.3-p327 via rvm with cumulative performance patch
#!/usr/bin/env bash
#
# This script will install Ruby 1.9.3-p327 via rvm with additional performance
# patches for faster Rails boot. Please refer to
#
# https://gist.github.com/1688857
#
# for detailed information. Run directly with:
#
# curl https://raw.github.com/gist/3786925/install.sh | bash
# install build dependencies on Ubuntu
if [ -x "/usr/bin/lsb_release" ]; then
distributor_id=$(/usr/bin/lsb_release -is)
if [ "${distributor_id}" == "Ubuntu" ] || [ "${distributor_id}" == "LinuxMint" ]; then
apt-get update && apt-get install build-essential libyaml-dev
# remove aliases on Ubuntu
unalias cp mv >/dev/null 2>&1
fi
fi
export LANG=en_US.utf8
export CFLAGS="-march=native -O3 -Wall -pipe -fomit-frame-pointer -fno-strict-aliasing"
export CXXFLAGS="${CFLAGS}"
rvm get head && rvm reload && rvm reinstall 1.9.3-perf --patch falcon --force-autoconf -j 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment