Help installing Ruby versions with RBENV

Locally (mac os 11.2.3 intel), I’m unable to install any new ruby versions with rbenv. It’s very frustrating. I’ve been googling and trying things for hours to no avail. This is the error below. Please give me ideas on what to do:

rbenv install 2.7.3
Downloading openssl-1.1.1k.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/892a0875b9872acd04a9fde79b1f943075d5ea162415de3047c327df33fbaee5
Installing openssl-1.1.1k...
Installed openssl-1.1.1k to /Users/ivanraszl/.rbenv/versions/2.7.3
Downloading ruby-2.7.3.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.3.tar.bz2
Installing ruby-2.7.3...
ruby-build: using readline from homebrew
BUILD FAILED (macOS 11.2.3 using ruby-build 20210423)
Inspect or clean up the working tree at /var/folders/75/dx25d4c508jc1wmrgl3597400000gn/T/ruby-build.20210426172158.79508.iDypcM
Results logged to /var/folders/75/dx25d4c508jc1wmrgl3597400000gn/T/ruby-build.20210426172158.79508.log
Last 10 log lines:
	from /private/var/folders/75/dx25d4c508jc1wmrgl3597400000gn/T/ruby-build.20210426172158.79508.iDypcM/ruby-2.7.3/lib/rubygems/core_ext/kernel_require.rb:83:in `require'
	from /private/var/folders/75/dx25d4c508jc1wmrgl3597400000gn/T/ruby-build.20210426172158.79508.iDypcM/ruby-2.7.3/lib/rubygems/package.rb:44:in `<top (required)>'
	from /private/var/folders/75/dx25d4c508jc1wmrgl3597400000gn/T/ruby-build.20210426172158.79508.iDypcM/ruby-2.7.3/lib/rubygems/core_ext/kernel_require.rb:83:in `require'
	from /private/var/folders/75/dx25d4c508jc1wmrgl3597400000gn/T/ruby-build.20210426172158.79508.iDypcM/ruby-2.7.3/lib/rubygems/core_ext/kernel_require.rb:83:in `require'
	from /private/var/folders/75/dx25d4c508jc1wmrgl3597400000gn/T/ruby-build.20210426172158.79508.iDypcM/ruby-2.7.3/lib/rubygems/installer.rb:11:in `<top (required)>'
	from /private/var/folders/75/dx25d4c508jc1wmrgl3597400000gn/T/ruby-build.20210426172158.79508.iDypcM/ruby-2.7.3/lib/rubygems/core_ext/kernel_require.rb:83:in `require'
	from /private/var/folders/75/dx25d4c508jc1wmrgl3597400000gn/T/ruby-build.20210426172158.79508.iDypcM/ruby-2.7.3/lib/rubygems/core_ext/kernel_require.rb:83:in `require'
	from ./tool/rbinstall.rb:713:in `<module:RbInstall>'
	from ./tool/rbinstall.rb:649:in `<main>'
make: *** [do-install-all] Error 1

While I am not on macOS and don’t use rbenv, I wrote about the differences between ruby-build (used here) and ruby-install, where the former uses a different way to install Ruby:

So I cannot really help you to dig deeper, but trying ruby-install (& chruby) might be an option?

1 Like

This issue is related to ruby-build, so you can submit an issue there. To get more info, you can add -v to rbenv install command. For example:

rbenv install -v 2.7.3
1 Like

OK, thank you very much.

I ran the rbenv install with the verbose option but still not enough information to help with troubleshooting. I have been looking online, and most people say running xcode-select install will fix the compiler issue, but that did not work for me

It’ll be great if you solved the issue and can share the result. Thanks in advance