EDIT
It looks like OP edited the error in the original message so the below answer is no longer relevant. Leaving it here for posterity.
Updated Answer
Based on discussion in a couple of Github issues on the rbenv repo,
it sounds like Apple changed the default CFLAGS
as part of xcode 12, which makes some of the native extension installations go haywire. It sounds like the solution proposed in those issues is
CFLAGS="-Wno-error=implicit-function-declaration" rbenv install 2.2.2
Original answer
The error states it failed due to issues with extensions
The Ruby readline extension was not compiled.
The Ruby zlib extension was not compiled.
ERROR: Ruby install aborted due to missing extensions
so I would suggest trying to install those extensions manually first, then retrying the ruby install.
With brew:
brew install readline
brew install zlib
There are some issues on ruby-build
's github that might help as well:
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…