Ruby-build: Ruby 2.4.1 build failed on macOS Sierra 10.12.3

Created on 26 Mar 2017  ·  23Comments  ·  Source: rbenv/ruby-build

Ruby 2.4.1 build fails on macOS Sierra 10.12.3, below the log I got

rbenv install 2.4.1
ruby-build: use openssl from homebrew
Downloading ruby-2.4.1.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.4/ruby-2.4.1.tar.bz2
Installing ruby-2.4.1...

BUILD FAILED (OS X 10.12.3 using ruby-build 20170201)

Inspect or clean up the working tree at /var/folders/j2/90b3sd_j3fqcgc2yxp_wwc600000gq/T/ruby-build.20170326214012.36750
Results logged to /var/folders/j2/90b3sd_j3fqcgc2yxp_wwc600000gq/T/ruby-build.20170326214012.36750.log

Last 10 log lines:
../.././include/ruby/ruby.h:2166:6: note: expanded from macro 'rb_scan_args_count_block'
     rb_scan_args_count_end(fmt, ofs, varc, vari) : \
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../.././include/ruby/ruby.h:2162:12: note: expanded from macro 'rb_scan_args_count_end'
    ((vari)/(!fmt[ofs] || rb_scan_args_bad_format(fmt)))
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
13 warnings and 1 error generated.
make[2]: *** [ossl_x509store.o] Error 1
make[1]: *** [ext/openssl/all] Error 2
make: *** [build-ext] Error 2

cat /var/folders/j2/90b3sd_j3fqcgc2yxp_wwc600000gq/T/ruby-build.20170326214012.36750.log | grep -i error
checking for ERRORFUNC function attribute... x
checking for strerror... yes
    CFLAGS = -O3 -Wno-error=shorten-64-to-32  -pipe
compiling error.c
compiling regerror.c
compiling dataerror.c
ossl_x509store.c:175:16: error: member reference type 'int' is not a pointer
13 warnings and 1 error generated.
make[2]: *** [ossl_x509store.o] Error 1
make[1]: *** [ext/openssl/all] Error 2
make: *** [build-ext] Error 2

my openssl is the latest:

brew info openssl
openssl: stable 1.0.2k (bottled) [keg-only]
SSL/TLS cryptography library
https://openssl.org/
/usr/local/Cellar/openssl/1.0.2d_1 (1,638 files, 12.1M)
  Poured from bottle on 2015-07-13 at 20:46:23
/usr/local/Cellar/openssl/1.0.2k (1,696 files, 12M)
  Poured from bottle on 2017-02-03 at 07:32:39
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/openssl.rb
==> Dependencies
Build: makedepend ✘
==> Options
--universal
    Build a universal binary
--without-test
    Skip build-time tests (not recommended)
==> Caveats
A CA file has been bootstrapped using certificates from the SystemRoots
keychain. To add additional certificates (e.g. the certificates added in
the System keychain), place .pem files in
  /usr/local/etc/openssl/certs

and run
  /usr/local/opt/openssl/bin/c_rehash

This formula is keg-only, which means it was not symlinked into /usr/local.

Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries

If you need to have this software first in your PATH run:
  echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile

For compilers to find this software you may need to set:
    LDFLAGS:  -L/usr/local/opt/openssl/lib
    CPPFLAGS: -I/usr/local/opt/openssl/include
For pkg-config to find this software you may need to set:
    PKG_CONFIG_PATH: /usr/local/opt/openssl/lib/pkgconfig

brew upgrade openssl
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
bash-git-prompt                                              checkstyle                                                   idris

Error: openssl 1.0.2k already installed

Any suggestion?

Most helpful comment

I had same issue after migration to new macbook pro using peer to peer migration, looks like Homebrew env crashed.
I fixed it by delete the brew include files:
sudo mv /usr/local/include /usr/local/include_old

All 23 comments

I couldn't reproduce it. Can you remove old version of openssl that is 1.0.2d_1 ?

I removed version 1.0.2d_1 but the problem persists

brew info openssl
openssl: stable 1.0.2k (bottled) [keg-only]
SSL/TLS cryptography library
https://openssl.org/
/usr/local/Cellar/openssl/1.0.2k (1,696 files, 12MB)
  Poured from bottle on 2017-02-03 at 07:32:39
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/openssl.rb
==> Dependencies
Build: makedepend ✘
==> Options
--universal
    Build a universal binary
--without-test
    Skip build-time tests (not recommended)
==> Caveats
A CA file has been bootstrapped using certificates from the SystemRoots
keychain. To add additional certificates (e.g. the certificates added in
the System keychain), place .pem files in
  /usr/local/etc/openssl/certs

and run
  /usr/local/opt/openssl/bin/c_rehash

This formula is keg-only, which means it was not symlinked into /usr/local.

Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries

If you need to have this software first in your PATH run:
  echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile

For compilers to find this software you may need to set:
    LDFLAGS:  -L/usr/local/opt/openssl/lib
    CPPFLAGS: -I/usr/local/opt/openssl/include
For pkg-config to find this software you may need to set:
    PKG_CONFIG_PATH: /usr/local/opt/openssl/lib/pkgconfig


rbenv install 2.4.1
ruby-build: use openssl from homebrew
Downloading ruby-2.4.1.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.4/ruby-2.4.1.tar.bz2
Installing ruby-2.4.1...

BUILD FAILED (OS X 10.12.3 using ruby-build 20170201)

Inspect or clean up the working tree at /var/folders/j2/90b3sd_j3fqcgc2yxp_wwc600000gq/T/ruby-build.20170327162603.1464
Results logged to /var/folders/j2/90b3sd_j3fqcgc2yxp_wwc600000gq/T/ruby-build.20170327162603.1464.log

Last 10 log lines:
../.././include/ruby/ruby.h:2166:6: note: expanded from macro 'rb_scan_args_count_block'
     rb_scan_args_count_end(fmt, ofs, varc, vari) : \
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../.././include/ruby/ruby.h:2162:12: note: expanded from macro 'rb_scan_args_count_end'
    ((vari)/(!fmt[ofs] || rb_scan_args_bad_format(fmt)))
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
13 warnings and 1 error generated.
make[2]: *** [ossl_x509store.o] Error 1
make[1]: *** [ext/openssl/all] Error 2
make: *** [build-ext] Error 2

cat /var/folders/j2/90b3sd_j3fqcgc2yxp_wwc600000gq/T/ruby-build.20170327162603.1464.log | grep -i error
checking for ERRORFUNC function attribute... x
checking for strerror... yes
    CFLAGS = -O3 -Wno-error=shorten-64-to-32  -pipe
compiling error.c
compiling regerror.c
compiling dataerror.c
ossl_x509store.c:175:16: error: member reference type 'int' is not a pointer
13 warnings and 1 error generated.
make[2]: *** [ossl_x509store.o] Error 1
make[1]: *** [ext/openssl/all] Error 2
make: *** [build-ext] Error 2

any other suggestions please?

Exactly the same problem here. Versions:

  • rbenv 1.1.0
  • ruby-build 20170201
  • openssl: stable 1.0.2k
  • osx 10.12.4

Any update on this issue please?
I tried to totally remove openssl, ruby-build, rbenv and restart from scratch, letting hombrew install all required dependencies, but problem remains the same.
Might be worth mentioning that same problem occurs also when trying to build ruby 2.4.0, 2.4.0-preview1, 2.4.0-preview2, 2.4.0-preview3, 2.4.0-rc1, 2.4.0-dev, 2.5.0-dev (below some of the output, fails always on "ossl_x509store.c:175:16: error: member reference type 'int' is not a pointer")

Whereas build succeeds for 2.3.3 (and beyond)

brew install rbenv
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
ats2-postiats                                                                              sqlite

==> Installing dependencies for rbenv: openssl, ruby-build
==> Installing rbenv dependency: openssl
==> Downloading https://homebrew.bintray.com/bottles/openssl-1.0.2k.sierra.bottle.tar.gz
Already downloaded: /Users/wissamabuahmad/Library/Caches/Homebrew/openssl-1.0.2k.sierra.bottle.tar.gz
==> Pouring openssl-1.0.2k.sierra.bottle.tar.gz
==> Using the sandbox
==> Caveats
A CA file has been bootstrapped using certificates from the SystemRoots
keychain. To add additional certificates (e.g. the certificates added in
the System keychain), place .pem files in
  /usr/local/etc/openssl/certs

and run
  /usr/local/opt/openssl/bin/c_rehash

This formula is keg-only, which means it was not symlinked into /usr/local.

Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries

If you need to have this software first in your PATH run:
  echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile

For compilers to find this software you may need to set:
    LDFLAGS:  -L/usr/local/opt/openssl/lib
    CPPFLAGS: -I/usr/local/opt/openssl/include
For pkg-config to find this software you may need to set:
    PKG_CONFIG_PATH: /usr/local/opt/openssl/lib/pkgconfig

==> Summary
🍺  /usr/local/Cellar/openssl/1.0.2k: 1,696 files, 12MB
==> Installing rbenv dependency: ruby-build
==> Downloading https://github.com/rbenv/ruby-build/archive/v20170322.tar.gz
Already downloaded: /Users/wissamabuahmad/Library/Caches/Homebrew/ruby-build-20170322.tar.gz
==> ./install.sh
🍺  /usr/local/Cellar/ruby-build/20170322: 339 files, 180.9KB, built in 1 second
==> Installing rbenv
==> Downloading https://homebrew.bintray.com/bottles/rbenv-1.1.0.sierra.bottle.tar.gz
Already downloaded: /Users/wissamabuahmad/Library/Caches/Homebrew/rbenv-1.1.0.sierra.bottle.tar.gz
==> Pouring rbenv-1.1.0.sierra.bottle.tar.gz
🍺  /usr/local/Cellar/rbenv/1.1.0: 36 files, 63.2KB


rbenv install 2.4.1
ruby-build: use openssl from homebrew
Downloading ruby-2.4.1.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.4/ruby-2.4.1.tar.bz2
Installing ruby-2.4.1...

BUILD FAILED (OS X 10.12.3 using ruby-build 20170201)

Inspect or clean up the working tree at /var/folders/j2/90b3sd_j3fqcgc2yxp_wwc600000gq/T/ruby-build.20170331121219.32992
Results logged to /var/folders/j2/90b3sd_j3fqcgc2yxp_wwc600000gq/T/ruby-build.20170331121219.32992.log

Last 10 log lines:
../.././include/ruby/ruby.h:2166:6: note: expanded from macro 'rb_scan_args_count_block'
     rb_scan_args_count_end(fmt, ofs, varc, vari) : \
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../.././include/ruby/ruby.h:2162:12: note: expanded from macro 'rb_scan_args_count_end'
    ((vari)/(!fmt[ofs] || rb_scan_args_bad_format(fmt)))
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
13 warnings and 1 error generated.
make[2]: *** [ossl_x509store.o] Error 1
make[1]: *** [ext/openssl/all] Error 2
make: *** [build-ext] Error 2

more /var/folders/j2/90b3sd_j3fqcgc2yxp_wwc600000gq/T/ruby-build.20170331121219.32992.log | grep -i error
checking for ERRORFUNC function attribute... x
checking for strerror... yes
    CFLAGS = -O3 -Wno-error=shorten-64-to-32  -pipe
compiling error.c
compiling regerror.c
compiling dataerror.c
ossl_x509store.c:175:16: error: member reference type 'int' is not a pointer
13 warnings and 1 error generated.
make[2]: *** [ossl_x509store.o] Error 1
make[1]: *** [ext/openssl/all] Error 2
make: *** [build-ext] Error 2




rbenv install 2.4.0
ruby-build: use openssl from homebrew
Downloading ruby-2.4.0.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.4/ruby-2.4.0.tar.bz2
Installing ruby-2.4.0...

BUILD FAILED (OS X 10.12.3 using ruby-build 20170201)

Inspect or clean up the working tree at /var/folders/j2/90b3sd_j3fqcgc2yxp_wwc600000gq/T/ruby-build.20170331122046.54791
Results logged to /var/folders/j2/90b3sd_j3fqcgc2yxp_wwc600000gq/T/ruby-build.20170331122046.54791.log

Last 10 log lines:
../.././include/ruby/ruby.h:2162:6: note: expanded from macro 'rb_scan_args_count_block'
     rb_scan_args_count_end(fmt, ofs, varc, vari) : \
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../.././include/ruby/ruby.h:2158:12: note: expanded from macro 'rb_scan_args_count_end'
    ((vari)/(!fmt[ofs] || rb_scan_args_bad_format(fmt)))
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
13 warnings and 1 error generated.
make[2]: *** [ossl_x509store.o] Error 1
make[1]: *** [ext/openssl/all] Error 2
make: *** [build-ext] Error 2


cat /var/folders/j2/90b3sd_j3fqcgc2yxp_wwc600000gq/T/ruby-build.20170331122046.54791.log | grep -i error
checking for ERRORFUNC function attribute... x
checking for strerror... yes
    CFLAGS = -O3 -Wno-error=shorten-64-to-32  -pipe
compiling error.c
compiling regerror.c
compiling dataerror.c
ossl_x509store.c:175:16: error: member reference type 'int' is not a pointer
13 warnings and 1 error generated.
make[2]: *** [ossl_x509store.o] Error 1
make[1]: *** [ext/openssl/all] Error 2
make: *** [build-ext] Error 2


rbenv install 2.4.0-preview3
ruby-build: use openssl from homebrew
Downloading ruby-2.4.0-preview3.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.4/ruby-2.4.0-preview3.tar.bz2
Installing ruby-2.4.0-preview3...

BUILD FAILED (OS X 10.12.3 using ruby-build 20170201)

Inspect or clean up the working tree at /var/folders/j2/90b3sd_j3fqcgc2yxp_wwc600000gq/T/ruby-build.20170331123039.76523
Results logged to /var/folders/j2/90b3sd_j3fqcgc2yxp_wwc600000gq/T/ruby-build.20170331123039.76523.log

Last 10 log lines:
../.././include/ruby/ruby.h:2155:6: note: expanded from macro 'rb_scan_args_count_block'
     rb_scan_args_count_end(fmt, ofs, varc, vari) : \
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../.././include/ruby/ruby.h:2151:12: note: expanded from macro 'rb_scan_args_count_end'
    ((vari)/(!fmt[ofs] || rb_scan_args_bad_format(fmt)))
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
13 warnings and 1 error generated.
make[2]: *** [ossl_x509store.o] Error 1
make[1]: *** [ext/openssl/all] Error 2
make: *** [build-ext] Error 2

cat /var/folders/j2/90b3sd_j3fqcgc2yxp_wwc600000gq/T/ruby-build.20170331123039.76523.log | grep -i error
checking whether -Werror=implicit-int is accepted as CFLAGS... yes
checking whether -Werror=pointer-arith is accepted as CFLAGS... yes
checking whether -Werror=write-strings is accepted as CFLAGS... yes
checking whether -Werror=declaration-after-statement is accepted as CFLAGS... yes
checking whether -Werror=shorten-64-to-32 is accepted as CFLAGS... yes
checking whether -Werror=implicit-function-declaration is accepted as CFLAGS... yes
checking whether -Werror=division-by-zero is accepted as CFLAGS... yes
checking whether -Werror=deprecated-declarations is accepted as CFLAGS... yes
checking whether -Werror=extra-tokens is accepted as CFLAGS... yes
checking for ERRORFUNC function attribute... x
checking for strerror... yes
                          -Wunused-variable -Werror=implicit-int \
                          -Werror=pointer-arith -Werror=write-strings \
                          -Werror=declaration-after-statement \
                          -Werror=shorten-64-to-32 \
                          -Werror=implicit-function-declaration \
                          -Werror=division-by-zero \
                          -Werror=deprecated-declarations \
                          -Werror=extra-tokens
    CFLAGS = -O3 -Wno-error=shorten-64-to-32  -pipe
compiling error.c
compiling regerror.c
compiling dataerror.c
ossl_x509store.c:116:16: error: member reference type 'int' is not a pointer
13 warnings and 1 error generated.
make[2]: *** [ossl_x509store.o] Error 1
make[1]: *** [ext/openssl/all] Error 2
make: *** [build-ext] Error 2

Same issue here, 2.4.1 didn't work, 2.3.3 works.

  • rbenv 1.1.0
  • ruby-build 20170201
  • OpenSSL 1.0.1h 5 Jun 2014
  • MacOS 10.12.3
  • XCode 8.3

Same problem here, can't install 2.4.1

MacOS X 10.12.3
Xcode 8.3
ruby-build 20170322
OpenSSL 1.0.2k

https://github.com/Homebrew/brew/pull/597

Here is the solution!!!!!!!! It works for me!
brew update
brew install openssl
ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/
ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/
ln -s /usr/local/Cellar/openssl/1.0.2j/bin/openssl openssl
ln -s /usr/local/share/dotnet/dotnet /usr/local/bin/dotnet

Thanks a lot.

In my case, I updated OS X n problem solved. Hopefully, this will work...

MacOS X 10.12.4
Xcode8.3
ruby-build 20170322
OpenSSL 1.0.2k

I had the same problem. This is what I did, but I'm not sure which step the error solved. My assumption is, that an old macport based version of openssl triggered the conflict.

$ rbenv install 2.4.1
BUILD FAILED (OS X 10.12.4 using ruby-build 20170322)
...
$ brew uninstall --force openssl
$ brew update && brew upgrade && brew cleanup && brew doctor
$ sudo rm -rf /opt/local
$ sudo rm -rf /Applications/DarwinPorts
$ sudo rm -rf /Applications/MacPorts
$ sudo rm -rf /Library/LaunchDaemons/org.macports.*
$ sudo rm -rf /Library/Receipts/DarwinPorts*.pkg
$ sudo rm -rf /Library/Receipts/MacPorts*.pkg
$ sudo rm -rf /Library/StartupItems/DarwinPortsStartup
$ sudo rm -rf /Library/Tcl/darwinports1.0
$ sudo rm -rf /Library/Tcl/macports1.0
$ sudo rm -rf ~/.macports
$ brew install --force [email protected]
$ rbenv install 2.4.1
...
Installed ruby-2.4.1 to /Users/Florian/.rbenv/versions/2.4.1

I had a similar issue. Turned out that I had the following in my .bash_profile. Commenting it out fixed my issues. I have a feeling this led to some conflicts with system libraries

#export LIBRARY_PATH=/opt/local/lib:/usr/local/lib

I fixed my issue. It was because of a leftover openssl install, plus some missing ENV variables that appeared in later brew openssl versions. In any case:

  1. brew update
  2. brew unlink openssl
  3. brew uninstall --ignore-dependencies openssl
  4. Repeat 2. until openssl is completely nuked
  5. brew install openssl
  6. Follow post install instructions:

    If you need to have this software first in your PATH run:
      echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.zshrc
    
    For compilers to find this software you may need to set:
        LDFLAGS:  -L/usr/local/opt/openssl/lib
        CPPFLAGS: -I/usr/local/opt/openssl/include
    For pkg-config to find this software you may need to set:
        PKG_CONFIG_PATH: /usr/local/opt/openssl/lib/pkgconfig
    
  7. Profit! rbenv install 2.4.1

@wissamir Have you ever solved this? Ruby 2.4.1 compiles fine for me on Sierra with latest Homebrew and its openssl 1.0.2k. Check that you don't have another openssl left over from macports or some other system.

@mislav, I've just tried this... yes I can confirm that workarounds explained above solve the issue also for me
I had to pay attention to old openssl versions installed by macports and remove also those
Many thanks

@shuriu your solution worked for me. Thank You.

even after using @mwxclauss solution (and @shuriu), you will probably still get BUILD ERROR with line like

SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version

The reason is because rbenv still use old system "curl", which knows nothing about your new "openssl v 1.1" (I used brew install [email protected]). For me, installing new version of curl with brew did the work:

brew install curl

Then add installed curl to your PATH (before default path, which is /usr/bin), and ensure that openssl of actual brew's version is also there:

export PATH="/usr/local/opt/[email protected]/bin:$PATH"
export PATH="/usr/local/opt/curl/bin:$PATH"

You can make sure after relaunch of terminal that latest versions of this programs will be used by trying

which -a openssl
which -a curl
openssl version -a
curl -V

First two commands should output all paths with the programs, but top ones should be brew versions. Last two commands should show latest versions of programs (1.1.0f and 7.55 for me now).

I use MacPorts, and I solved this by exporting my PATH variable to only include items from rbenv and the system.

$ export PATH=/Users/john/.rbenv/shims:/Users/john/.rbenv/bin:/usr/bin:/bin:/usr/sbin:/sbin
$ rbenv install 2.4.1
Downloading openssl-1.1.0f.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/12f746f3f2493b2f39da7ecf63d7ee19c6ac9ec6a4fcd8c229da8a522cb12765
Installing openssl-1.1.0f...
Installed openssl-1.1.0f to /Users/john/.rbenv/versions/2.4.1

Downloading ruby-2.4.1.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.4/ruby-2.4.1.tar.bz2
Installing ruby-2.4.1...
Installed ruby-2.4.1 to /Users/john/.rbenv/versions/2.4.1

I was Unable to install ruby 2.4.1 with openssl but I I was able to install with [email protected]

  1. brew uninstall openssl --ignore-dependencies I had a 1.0.1l version.
  2. brew cleanup
  3. brew install [email protected] installed [email protected]: stable 1.1.0f (bottled) [keg-only]
  4. export PATH="/usr/local/opt/[email protected]/bin:$PATH" in my ~/.bashrc file
  5. rbenv install 2.4.1 (previously upgraded ruby-build)

It seems the install downloaded openssl as part of ruby installation. Does that mean ruby-build did not use the [email protected] installed in previous step?

My install output shows

$ rbenv install 2.4.1
Downloading openssl-1.1.0f.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/12f746f3f2493b2f39da7ecf63d7ee19c6ac9ec6a4fcd8c229da8a522cb12765
Installing openssl-1.1.0f...
Installed openssl-1.1.0f to /Users/marekj/.rbenv/versions/2.4.1

Downloading ruby-2.4.1.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.4/ruby-2.4.1.tar.bz2
Installing ruby-2.4.1...
ruby-build: use readline from homebrew
Installed ruby-2.4.1 to /Users/marekj/.rbenv/versions/2.4.1

When I type brew missing I still see I am missing openssl even if I have [email protected] installed and PATH to it set.

$ brew missing
libevent: openssl
libssh: openssl
libssh2: openssl
mongodb: openssl
nmap: openssl
openssl-osx-ca: openssl
phantomjs: openssl
postgresql: openssl
rbenv: openssl
ruby: openssl
ruby-build: openssl
tmate: openssl
tmux: openssl

Thanks a lot.

The solution from @sintro to install the curl works for me.

Struggling with getting rbenv up and running on my mac:

macOS 10.13.2
rbenv 1.1.1
OpenSSL 1.1.0g 2 Nov 2017
curl 7.57.0

% which rbenv
/usr/local/bin/rbenv
% which openssl
/usr/local/opt/[email protected]/bin/openssl
% which curl
/usr/local/opt/curl/bin/curl

rbenv, curl, openssl - all in PATH

% rbenv install 2.4.1
ruby-build: use openssl from homebrew
Downloading ruby-2.4.1.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.4/ruby-2.4.1.tar.bz2
Installing ruby-2.4.1...

BUILD FAILED (OS X 10.13.2 using ruby-build 20171215)

Inspect or clean up the working tree at /var/folders/31/41tck3qx69scnynksxc_38ch0000gn/T/ruby-build.20171220150125.94300
Results logged to /var/folders/31/41tck3qx69scnynksxc_38ch0000gn/T/ruby-build.20171220150125.94300.log

Last 10 log lines:
checking for long long... yes
checking for off_t... yes
checking char bit... 8
checking size of int... 0
checking size of short... 0
checking size of long... 0
checking size of long long... configure: error: in `/var/folders/31/41tck3qx69scnynksxc_38ch0000gn/T/ruby-build.20171220150125.94300/ruby-2.4.1':
configure: error: cannot compute sizeof (long long)
See `config.log' for more details
make: *** No targets specified and no makefile found.  Stop.

Tried all solutions listed above - nothing helped.
Any suggestion?

I was having the same issue.

MacOS Version 10.13.2 (17C88)
Ruby 2.4.2
OpenSSL 1.0.2n

I resolved with

brew update && brew upgrade openssl
export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"
export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig"
brew upgrade ruby-build
rbenv install 2.4.2

I had same issue after migration to new macbook pro using peer to peer migration, looks like Homebrew env crashed.
I fixed it by delete the brew include files:
sudo mv /usr/local/include /usr/local/include_old

Thanks everyone for sharing your workarounds!

Closing due to staleness. Hopefully people don't have this problem anymore.

I had same issue after migration to new macbook pro using peer to peer migration, looks like Homebrew env crashed.
I fixed it by delete the brew include files:
sudo mv /usr/local/include /usr/local/include_old

In order for me to do this on macOS Catalina I had to:

  1. Disable SIP (System Integrity Protection) by rebooting into Recovery Mode and running csrutil disable in the Terminal.

  2. Remount root as a writable volume with sudo mount -uw /.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

noraj picture noraj  ·  4Comments

dpaluy picture dpaluy  ·  6Comments

tom-mayer picture tom-mayer  ·  3Comments

ghost picture ghost  ·  4Comments

florentmorin picture florentmorin  ·  5Comments