Skip to content

Instantly share code, notes, and snippets.

@marcjeanson
Last active January 16, 2019 22:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save marcjeanson/79c03aa25b7839fe25354446cf8041c0 to your computer and use it in GitHub Desktop.
Save marcjeanson/79c03aa25b7839fe25354446cf8041c0 to your computer and use it in GitHub Desktop.
Install ruby 1.8.7 with asdf on macOS Mojave (10.14)
#!/bin/sh
# inspired by https://gist.github.com/yatsu/b62f07ef9ff3ae1e0e2bf9a00b8742b6
# Assumes you already have homebrew and asdf installed!
# brew install openssl gcc@4.9
# If your macOS is Mojave (10.14), install Xcode 10 and
# /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
# (See https://developer.apple.com/documentation/xcode_release_notes/xcode_10_release_notes)
CC=gcc-4.9 \
CFLAGS="-O2 -fno-tree-dce -fno-optimize-sibling-calls -I$(brew --prefix openssl)/include" \
LDFLAGS="-L$(brew --prefix openssl)/lib" \
asdf install ruby 1.8.7-p375
@btburton42
Copy link

my build failed, but for new and different reasons than before:

ruby-build: use openssl from homebrew
Downloading ruby-2.3.3.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.3.tar.bz2
Installing ruby-2.3.3...

BUILD FAILED (OS X 10.14.2 using ruby-build 20181225)

Inspect or clean up the working tree at /var/folders/m3/wgz_qcgs5sgbrwkp6fw7sh_h0000gq/T/ruby-build.20190116154449.53629
Results logged to /var/folders/m3/wgz_qcgs5sgbrwkp6fw7sh_h0000gq/T/ruby-build.20190116154449.53629.log

Last 10 log lines:
gcc-4.9: error: unrecognized command line option '-iwithsysroot'
make[2]: *** [stubs.o] Error 1
make[1]: *** [ext/tk/all] Error 2
make[1]: *** Waiting for unfinished jobs....
compiling ifaddr.c
installing default socket libraries
compiling init.c
compiling constants.c
linking shared-object socket.bundle
make: *** [build-ext] Error 2

nothing i can find makes mention of that CLI opt -iwithsysroot

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