Skip to content

Instantly share code, notes, and snippets.

@wmakley
Forked from silviorelli/gist:ad8e1d80bdc0245eb7e7
Last active October 7, 2021 09:41
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save wmakley/8dfe436dfe345efae3ddf6756f9766b6 to your computer and use it in GitHub Desktop.
Save wmakley/8dfe436dfe345efae3ddf6756f9766b6 to your computer and use it in GitHub Desktop.
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
# 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'
Copy link

ghost commented Oct 27, 2017

I get an error on El Sierra,10.12.6

$uname -a
Darwin localhost 16.7.0 Darwin Kernel Version 16.7.0: Thu Jun 15 17:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64 x86_64

$brew install homebrew/dupes/apple-gcc42
Warning: Use apple-gcc42 instead of deprecated homebrew/dupes/apple-gcc42
apple-gcc42: This formula either does not compile or function as expected on macOS
versions newer than Mavericks due to an upstream incompatibility.
Error: An unsatisfied requirement failed this build.

@jerimiahmilton
Copy link

@MPvdBurg
Copy link

MPvdBurg commented Nov 27, 2017

@rteeuwen
Copy link

rteeuwen commented Jan 3, 2018

@estevaoam
Copy link

If you're in the unfortunate journey of installing these legacy versions, I'm using rvm and managed to install the 1.8.7 on Sierra with this command:

rvm install 1.8.7 --with-gcc=clang

@wmakley
Copy link
Author

wmakley commented Aug 10, 2019

Thanks @estevaom! My instructions stopped working for me completely and I have just been Docker. To everyone referring to my gist, please note that it certainly does not work any more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment