Skip to content

Instantly share code, notes, and snippets.

@dammer
Forked from fgrehm/ree-1.8.7-2011.03
Last active September 3, 2015 13:49
Show Gist options
  • Save dammer/06fb4b26b9248540a89a to your computer and use it in GitHub Desktop.
Save dammer/06fb4b26b9248540a89a to your computer and use it in GitHub Desktop.
ruby-build REE definitions for Ubuntu 12.04
http://makandracards.com/makandra/21189-how-to-install-older-versions-of-ree-with-rbenv-on-ubuntu-12-04
How to install older versions of REE with rbenv on Ubuntu 12.04
Rbenv won't compile REE 2011.03 properly on Ubuntu 12.04, failing with an error in tcmalloc.cc.
If you want to keep tcmalloc functionality, you can do it like this:
Open ~/.rbenv/plugins/ruby-build/share/ruby-build/ree-1.8.7-2011.03
Replace the file's contents with those from fgrehm's gist
rbenv install again
You could also try CONFIGURE_OPTS="--no-tcmalloc" rbenv install, but that would disable tcmalloc. Doing that, you might still encounter issues with ossl_ssl.c – which is where I switched to the patched solution above.
Note the gist also includes a patch for REE 2012.02. You need to modify ~/.rbenv/plugins/ruby-build/share/ruby-build/ree-1.8.7-2012.02 instead, of course.
Growing Rails Applications in Practice
https://github.com/sstephenson/ruby-build/wiki#187-p302-and-lower-segfaults-for-https-requests-on-os-x-107
Ruby 1.8.7 patchlevel 302 (and below, possibly above, including ruby enterprise edition) have a known compiler bug, however compiling Ruby will finish without errors. The bug will cause a segmentation fault whenever an SSL connection is opened, like .../timeout.rb:60: [BUG] Segmentation fault.
Try setting the following flags and recompiling Ruby:
CFLAGS="-O2 -fno-tree-dce -fno-optimize-sibling-calls" rbenv install 1.8.7-p302
build_package_patched() {
# These three patches are included when RVM builds REE
cd source
wget 'https://github.com/wayneeseguin/rvm/raw/master/patches/ree/1.8.7/tcmalloc.patch'
wget 'https://github.com/wayneeseguin/rvm/raw/master/patches/ree/1.8.7/stdout-rouge-fix.patch'
wget 'https://github.com/wayneeseguin/rvm/raw/master/patches/ree/1.8.7/no_sslv2.diff'
patch -p1 < tcmalloc.patch
patch -p1 < stdout-rouge-fix.patch
patch -p1 < no_sslv2.diff
cd ..
}
require_gcc
install_package "ruby-enterprise-1.8.7-2011.03" "http://rubyenterpriseedition.googlecode.com/files/ruby-enterprise-1.8.7-2011.03.tar.gz" patched ree_installer
install_package "rubygems-1.8.24" "http://production.cf.rubygems.org/rubygems/rubygems-1.8.24.tgz" ruby
build_package_patched() {
# These three patches are included when RVM builds REE
cd source
wget 'https://github.com/wayneeseguin/rvm/raw/master/patches/ree/1.8.7/tcmalloc.patch'
wget 'https://github.com/wayneeseguin/rvm/raw/master/patches/ree/1.8.7/stdout-rouge-fix.patch'
# already applied?!: wget 'https://github.com/wayneeseguin/rvm/raw/master/patches/ree/1.8.7/no_sslv2.diff'
patch -p1 < tcmalloc.patch
patch -p1 < stdout-rouge-fix.patch
# patch -p1 < no_sslv2.diff
cd ..
}
require_gcc
install_package "ruby-enterprise-1.8.7-2012.02" "http://rubyenterpriseedition.googlecode.com/files/ruby-enterprise-1.8.7-2012.02.tar.gz" patched ree_installer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment