Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Install Ruby 1.8.7 on Mac OSX 10.12 Sierra with rbenv
#!/bin/sh
# The main issues with Ruby 1.8.7 are that it won't build with Clang,
# and the Net::HTTPS module won't work with modern versions of OpenSSL.
#
# This assumes you have already set up homebrew, and run: xcode-select --install
#brew install homebrew/dupes/apple-gcc42
#brew install libyaml libffi
brew install https://github.com/Homebrew/homebrew-versions/raw/586b7e9012a3ed1f9df6c43d0483c65549349289/openssl098.rb
export CC=/usr/local/bin/gcc-4.2
export CFLAGS='-g -O2'
export RUBY_CONFIGURE_OPTS=--with-openssl-dir=/usr/local/opt/openssl098
export CONFIGURE_OPTS=--with-openssl-dir=/usr/local/opt/openssl098
#rbenv install 1.8.7-p375
rbenv install 1.8.7
# Important gems:
# Rake is not installed by default, but you should start with a very old version before installing 10+:
gem install rake -v 0.7.3 # needed for very old Rails sites and some old gems to install
gem install slimgems # needed for Rails 1 + 2 to install
# if you want the latest rdoc for 1.8:
gem install rdoc -v 3.12.2
gem install rdoc-data -v 3.12
rdoc-data --install
# as of this writing, the latest version of bundler, 1.14.5, was still backwards compatible with Ruby 1.8
gem install bundler
# The following gem versions are known to be the last working 1.8 versions:
# gem 'rack', '~> 1.1.0'
# gem 'pg', '~> 0.17.1'
# gem 'i18n', '0.6.11'
# gem 'money', '4.0.2'
# gem 'nokogiri', '~> 1.5.10'
# gem 'activemerchant', '~> 1.43.2'
# gem 'httpclient', '~> 2.7.0'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.