ruby-build: Unable to install REE on OS X 10.11
Hey, having an issue building (an old) version of Ruby.
Downloading ruby-enterprise-1.8.7-2011.12.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/9a8efc4befc136e17a1360de549aac9e79283c7238a13215350720e4393c5da2
Installing ruby-enterprise-1.8.7-2011.12...
BUILD FAILED (OS X 10.11 using ruby-build 20150928)
Inspect or clean up the working tree at /var/folders/wv/qw46bgcn37793q0wht63x3wr0000gn/T/ruby-build.20151023113042.56615
Results logged to /var/folders/wv/qw46bgcn37793q0wht63x3wr0000gn/T/ruby-build.20151023113042.56615.log
Last 10 log lines:
ar rcu libruby-static.a array.o bignum.o class.o compar.o dir.o dln.o enum.o enumerator.o error.o eval.o file.o gc.o hash.o inits.o io.o marshal.o math.o numeric.o object.o pack.o parse.o pointerset.o process.o prec.o random.o range.o re.o regex.o ruby.o signal.o sprintf.o st.o string.o struct.o time.o util.o variable.o version.o  dmyext.o
/usr/local/bin/gcc-4.2 -g -O2  -pipe -fno-common    -DRUBY_EXPORT  -I. -I. -I/Users/carl/.rbenv/versions/ree-1.8.7-2011.12/include  -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -c main.c
/usr/local/bin/gcc-4.2 -g -O2  -pipe -fno-common    -DRUBY_EXPORT  -I. -I. -I/Users/carl/.rbenv/versions/ree-1.8.7-2011.12/include  -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -c dmydln.c
/usr/local/bin/gcc-4.2 -g -O2  -pipe -fno-common    -DRUBY_EXPORT  -L. -L/Users/carl/.rbenv/versions/ree-1.8.7-2011.12/lib    main.o dmydln.o libruby-static.a -L/opt/local/lib -Wl,-rpath,/Users/carl/.rbenv/versions/ree-1.8.7-2011.12/lib -L/Users/carl/.rbenv/versions/ree-1.8.7-2011.12/lib -lsystem_allocator -ldl -lobjc   -o miniruby
ld: warning: directory not found for option '-L/opt/local/lib'
dyld: Library not loaded: @rpath/libsystem_allocator.dylib
  Referenced from: /private/var/folders/wv/qw46bgcn37793q0wht63x3wr0000gn/T/ruby-build.20151023113042.56615/ruby-enterprise-1.8.7-2011.12/source/./miniruby
  Reason: image not found
make: *** [.rbconfig.time] Trace/BPT trap: 5
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Reactions: 1
- Comments: 36 (9 by maintainers)
@madrobby I have moved on as well…but for that certain, annoying old legacy rails 2 project which we can’t get rid of yet, I need ree-1.8.7.
In the meantime, I have found a solution for macOS Sierra to install ree-1.8.7-2012.02
csrutil disable,rebootbrew install opensslbrew link openssl, it won’t do it anyway because openssl is keg-onlyRUBY_CONFIGURE_OPTS=--with-openssl-dir=/usr/local/opt/openssl rbenv install ree-1.8.7-2012.02csrutil enable,rebootdone.
@jbwl This nearly worked for me. In order to get past the error
* OpenSSL development headers... not foundI needed to run the following:CFLAGS=-I/usr/local/opt/openssl/include RUBY_CONFIGURE_OPTS=--with-openssl-dir=/usr/local/opt/openssl rbenv install@gblakeman @ngzax Thanks for your information on System Integrity Protection, using this I could compile REE 2012.02 with OpenSSL 1.0.2f, which finally makes TLSv1.2 work for HTTPS connections. I also had to set the compiler flags mentioned in the wiki in order to prevent segfaults with installing gems (and other network connections).
Here’s a complete rundown of what worked for me on OS X 10.11.2 to install REE 2012.02 w/ OpenSSL 1.0.2f.
Before you start, run
brew upgradeandbrew doctorto clean up any problems.Boot into Recovery Mode (press and hold ⌘R when you hear the startup chime). In the “Utilities” menu select “Terminal”.
(Wait for reboot to complete, just sign in to your Mac normally.)
Prerequisites: you’ll need the latest Xcode and command line tools installed, as well as homebrew. For completeness sake, I’ve included instructions on how to install and update rbenv and ruby-build with homebrew, this might differ if you installed them from git or otherwise.
Hope this helps someone! 😃
For anyone finding this from Google, it appears that at some point in a later build of Sierra, Apple removed
gcc4.2, or made some updates tollvm-gccwhich would allow “successful” REE builds (if you use the OpenSSLCFLAGSetc.), but when you would attempt to do anything with that build (such asgem install bundler), you’d get errors like:If you follow the instructions from above (disable SIP, install OpenSSL) but also install
gcc@4.6withbrewAND use it to do the REE build, you should be peachy, complete with workinggem install’s:As @jeremy suspected, the issue is El Capitan’s System Integrity Protection. I was able to get
ree-1.8.7-2012.02installed by disabling it, which requires booting into Recovery Mode, installing, then re-enabling it.I also ran into an OpenSSL issue. My process:
openssl098viabrew(opensslcreated a conflict with the system openssl)brew link openssl098 --forceree(with System Integrity Protection disabled)openssl098/cc @NatashaTheRobot
REE is EOL status. We will not investigate this issue.
I managed to get a fully functional ree-1.8.7-2012.02 (
ruby+gem) for Mac OS 10.13.1 (High Sierra) with this:CC=/usr/local/Cellar/gcc@4.9/4.9.4/bin/gcc-4.9 CFLAGS="-O2 -fno-tree-dce -fno-optimize-sibling-calls -I/usr/local/opt/openssl/include -I/usr/local/opt/zlib/include" RUBY_CONFIGURE_OPTS="--with-openssl-dir=/usr/local/opt/openssl --with-zlib-dir=/usr/local/opt/zlib" rbenv install ree-1.8.7-2012.02https://serverfault.com/questions/456640/segfault-in-timeout-rb-using-gem-with-ruby-enterprise-edition-ree-1-8-7
@jbwl : “Newer openssl versions don’t work with ruby-build.”
I recently needed to build a version of ree-1.8.7-2012.02 linked to openssl 1.0.+ because I needed TLS 1.2 support in ree. Using @gblakeman 's instructions above to disable system protection, I was able to brew install openssl 1.0.2, brew link it, disable protection, and then “rbenv install ree” which built it with openssl 1.0.2.
So your issue may not be openssl, it may be the OS X System Integrity Protection, which needs to be disabled.