Skip to content

Instantly share code, notes, and snippets.

@wearethefoos
Created November 23, 2012 14:39
Show Gist options
  • Save wearethefoos/4135896 to your computer and use it in GitHub Desktop.
Save wearethefoos/4135896 to your computer and use it in GitHub Desktop.
Fixed Rbenv Ruby 1.9.3 falcon patch with CFLAGS for Rackspace Cloud servers

Rbenv Ruby 1.9.3 p194 - Falcon patched on Rackspace Ubuntu 12.04 LTS (Precise Pangolin)

Install these packages:

  $ apt-get install build-essential zlib1g zlib1g-dev \
     libreadline6 libreadline6-dev libssl-dev libyaml-dev \
     libffi-dev libgdbm-dev libx11-dev aptitude libtidy-dev \
     libxml2-dev libevent-dev libev-dev autoconf

Then use rbenv to install the patched package:

curl https://raw.github.com/gist/4135896/bb2172419767bd8bb324d1fb27df1e8f9b56668c/rbenv.sh | sh ; rbenv global 1.9.3-p194-perf

It has some minor fixes/advantages over the original one by @burke: The hashes after the package urls (checksums fail otherwise):

install_package "yaml-0.1.4" "http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz#36c852831d02cf90508c29852361d01b"

And additional CFLAGS for the Rackspace servers:

make -j 8 CFLAGS="-O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Werror=pointer-arith -Werror=write-strings -Werror=declaration-after-statement -Werror=implicit-function-declaration  -fPIC -march=barcelona -pipe"

I added two files without the CFLAGS if you don't want that:

curl https://raw.github.com/gist/4135896/a7cf8d277e8c1537990a782ecc8febc987c47d58/zrbenv_no_cflags.sh | sh ; rbenv global 1.9.3-p194-perf
VERSION="1.9.3-p194"
curl https://gist.github.com/raw/4135896/4e584fc8589f05166d7859f3861782bef9390601/ruby-1.9.3-p194-perf.sh > /tmp/$VERSION-perf
rbenv install /tmp/$VERSION-perf
build_package_combined_patch() {
local package_name="$1"
{
curl https://raw.github.com/gist/2593385/perf_and_gc.diff | patch -p1
autoconf
./configure --prefix="$PREFIX_PATH" $CONFIGURE_OPTS
make -j 8 CFLAGS="-O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Werror=pointer-arith -Werror=write-strings -Werror=declaration-after-statement -Werror=implicit-function-declaration -fPIC -march=barcelona -pipe"
make install
} >&4 2>&1
}
install_package "yaml-0.1.4" "http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz#36c852831d02cf90508c29852361d01b"
install_package "ruby-1.9.3-p194" "http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.gz#bc0c715c69da4d1d8bd57069c19f6c0e" combined_patch
VERSION="1.9.3-p194"
curl https://raw.github.com/gist/4135896/5d39952b80775336d03adfade9b727caf25f6975/zruby-1.9.3-p194-perf.sh > /tmp/$VERSION-perf
rbenv install /tmp/$VERSION-perf
build_package_combined_patch() {
local package_name="$1"
{
curl https://raw.github.com/gist/2593385/perf_and_gc.diff | patch -p1
autoconf
./configure --prefix="$PREFIX_PATH" $CONFIGURE_OPTS
make -j 8
make install
} >&4 2>&1
}
install_package "yaml-0.1.4" "http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz#36c852831d02cf90508c29852361d01b"
install_package "ruby-1.9.3-p194" "http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.gz#bc0c715c69da4d1d8bd57069c19f6c0e" combined_patch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment