Skip to content

Instantly share code, notes, and snippets.

@dammer
Forked from jnx/rbenv-install-system-wide.sh
Last active December 18, 2015 09:18
Show Gist options
  • Select an option

  • Save dammer/5760056 to your computer and use it in GitHub Desktop.

Select an option

Save dammer/5760056 to your computer and use it in GitHub Desktop.
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
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y install build-essential libreadline-dev git-core
# Install rbenv
git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv
# Add rbenv to the path:
echo '# rbenv setup' > /etc/profile.d/rbenv.sh
echo 'export RBENV_ROOT=/usr/local/rbenv' >> /etc/profile.d/rbenv.sh
echo 'export PATH="$RBENV_ROOT/bin:$PATH"' >> /etc/profile.d/rbenv.sh
echo 'eval "$(rbenv init -)"' >> /etc/profile.d/rbenv.sh
chmod +x /etc/profile.d/rbenv.sh
# puppet
chattr +a /etc/profile.d/rbenv.sh
source /etc/profile.d/rbenv.sh
# Install ruby-build:
pushd /tmp
git clone git://github.com/sstephenson/ruby-build.git
cd ruby-build
./install.sh
popd
# Install Ruby 1.9.2-p429:
rbenv install 1.9.3-p429
rbenv global 1.9.3-p429
# Rehash:
rbenv rehash
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y install build-essential libreadline-dev git-core
# Install rbenv:
git clone git://github.com/sstephenson/rbenv.git ~/.rbenv
# Add rbenv to the path:
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> .bash_profile
echo 'eval "$(rbenv init -)"' >> .bash_profile
source ~/.bash_profile
# Install ruby-build:
pushd /tmp
git clone git://github.com/sstephenson/ruby-build.git
cd ruby-build
./install.sh
popd
# Install Ruby 1.9.2-p429:
rbenv install 1.9.3-p429
rbenv global 1.9.3-p429
# Rehash:
rbenv rehash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment