ruby-build: Unable to install Ruby 2.6.5 on macOS 10.15 Catalina

Hi,

I’m trying to rbenv install 2.6.5 after upgrading from Mojave to Catalina and I am getting the following error(s):

rbenv install
ruby-build: using openssl from homebrew
Downloading ruby-2.6.5.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.5.tar.bz2
Installing ruby-2.6.5...
ruby-build: using readline from homebrew

BUILD FAILED (OS X 10.15 using ruby-build 20191004)

Inspect or clean up the working tree at /var/folders/j8/dw62n33d4gl3y2nzr_ky09400000gn/T/ruby-build.20191008094457.36804
Results logged to /var/folders/j8/dw62n33d4gl3y2nzr_ky09400000gn/T/ruby-build.20191008094457.36804.log

Last 10 log lines:
int     sigvec(int, struct sigvec *, struct sigvec *);
                                                   ^
                                                    _Nonnull
190 warnings generated.
190 warnings generated.
216 warnings generated.
190 warnings generated.
216 warnings generated.
190 warnings generated.
221 warnings generated.

Any clue on how to fix this?

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 5
  • Comments: 37 (4 by maintainers)

Most upvoted comments

@bforma @mamantoha Try this SDKROOT="/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk".

Oh, probably RUBY_CONFIGURE_OPTS is good for ruby-build users.

RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl)" rbenv install [version]

I believe this will work as well if you’re unable or unwilling to disable SIP. Give me a bit and I’ll restore the old version and see if this solves it.

Oh, probably RUBY_CONFIGURE_OPTS is good for ruby-build users.

RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl)" rbenv install [version]

I’ve set CPATH=/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include, otherwise there is a complaint that stdio.h cannot be found.

Thanks @bforma . I have the same issue.

Actually unlinking llvm didn’t help me. I completely uninstall all llvm versions via brew. And then it was fixed.

I could install 2.6.5 with Catalina

‚ùØ rbenv install 2.6.5
ruby-build: using openssl from homebrew
Downloading ruby-2.6.5.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.5.tar.bz2
Installing ruby-2.6.5...
ruby-build: using readline from homebrew
Installed ruby-2.6.5 to /Users/hsbt/.local/share/rbenv/versions/2.6.5

Maybe, you need to invoke xcode-select --install again.

@bforma @mamantoha Problems on the macOS related with LLVM have been fixed in https://github.com/Homebrew/homebrew-core/pull/45304 and it has been merged today so it’s already available in the latest brew.

Could you try this?

brew update
brew upgrade
brew uninstall llvm
brew install llvm

You can check statuses of other LLVM versions can be seen in https://github.com/Homebrew/homebrew-core/issues/45061#issuecomment-547671808.

Got it working. Apparently I had an old version (6) of llvm linked via brew (thus also using an old version of clang). brew unlink llvm@6 fixed that. Also needed to unset CPATH.

I tried but couldn’t reproduce the initial issue. 🤷‍♂

So, for others, it’s worth trying this solution before replacing the system’s openssl.

👍

@joshuapinter and @imbsky I was able to install ruby using RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl)" rbenv install and it worked great. Thanks for finding solutions for this issue!

Oh, probably RUBY_CONFIGURE_OPTS is good for ruby-build users.

RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl)" rbenv install [version]

I believe this will work as well if you’re unable or unwilling to disable SIP. Give me a bit and I’ll restore the old version and see if this solves it.

This one worked for me. My openssl was linked to libressl.

Does not work. I tried: RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl)" rbenv install 2.6.5 But I still get the same Error BUILD FAILED (OS X 10.15.2 using ruby-build ...)

I try gem install bundler- but get the following error:

ERROR: While executing gem … (Errno::EACCES) Permission denied @ rb_sysopen - /Users/cibuild/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/bundler-2.1.0/CHANGELOG.md

What else can I do ?

@jarod-legault I’m glad to hear that! Have a good rbenv life.

I tried but couldn’t reproduce the initial issue. 🤷‍♂

So, for others, it’s worth trying this solution before replacing the system’s openssl.

👍