Skip to content

Instantly share code, notes, and snippets.

@meineerde
Last active October 6, 2021 11:16
Show Gist options
  • Save meineerde/84744448400ee49062a43b28a6ac5360 to your computer and use it in GitHub Desktop.
Save meineerde/84744448400ee49062a43b28a6ac5360 to your computer and use it in GitHub Desktop.
Install Ruby 1.8.7 on macOS Catalina with ruby-install
brew install rbenv/tap/openssl@1.0
brew install gcc@6
brew install ruby-install

"Patch" ruby-install:

$EDITOR /usr/local/Cellar/ruby-install/0.8.1/share/ruby-install/ruby/functions.sh

Set opt_dir="$(brew —prefix openssl@1.0)... (i.e. add the @1.0)

Now install Ruby 1.8.7

CC=gcc-6 CFLAGS="-O2 -fno-tree-dce -fno-optimize-sibling-calls -I$(brew --prefix openssl@1.0)/include -I/opt/X11/include" LDFLAGS="-L$(brew --prefix openssl@1.0)/lib -L /opt/X11/lib" ruby-install ruby-1.8.7-p374 -u https://cache.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p374.tar.gz
@meineerde
Copy link
Author

With rbenv:

CC=gcc-6 RUBY_CFLAGS="-O2 -fno-tree-dce -fno-optimize-sibling-calls" CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl@1.0)" RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl@1.0)" LDFLAGS="-L$(brew --prefix openssl@1.0)/lib" CPPFLAGS="-I$(brew --prefix openssl@1.0)/include" rbenv install 1.8.7

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