[SOLVED] Ruby install aborted due to missing extensions


#1

Hello guys
I’m having some issues installing Ruby on my Mac OS 10.14.1.
I believe everything is fine, until I get to the part where I have to install Ruby’s latest version.

rbenv install 2.6.5 --verbose

After entering this command and waiting the +10 mins, I get these:

The Ruby zlib extension was not compiled.
ERROR: Ruby install aborted due to missing extensions
(...)
BUILD FAILED (OS X 10.14.1 using ruby-build 20191111) 

Inspect or clean up the working tree at /var/folders/yv/q_d_mftj6cqd2x0c9mqqfkm80000gp/T/ruby-build.20191118185151.38422.IxPCaw
Results logged to /var/folders/yv/q_d_mftj6cqd2x0c9mqqfkm80000gp/T/ruby-build.20191118185151.38422.log

Last 10 log lines:
ERROR: Ruby install aborted due to missing extensions

When I check for my current Ruby version, I get

ruby 2.3.7p456 (2018-03-28 revision 63024) [universal.x86_64-darwin18]

I’ve already tried restarting terminal and going through the whole process again, and nothing.
I’ve also tried uninstalling rbenv and reinstalling it, and going through all the Ruby installment, and it didn’t work either.

What do you suggest?
Thanks!


[SOLVED] Problem installing lastest version of Ruby
#2

What does the command below return entered in your terminal?

brew doctor

Update: never mind the command above. You most likely installed Ruby via rbenv not brew.

Some other user had the same problem but never reported back if he solved the problem - Installing Ruby: Build Failed.

Try to check of you have the libz folder via the command provided in the linked post.

Some have reported similar issues to the rbenv team and either installing zlib via brew or removing the libz folder has solved the issue for them - https://github.com/rbenv/ruby-build/issues/832.


#3

Try brew install zlib


#4

Yes!! I finally got the expected output

Installed ruby-2.6.5 to /Users/xxxx/.rbenv/versions/2.6.5

Thank you @pievelna @CouchofTomato :smiley:


#5

brew install zlib
This was the solution