First install readline from homebrew
brew install readline
brew link --force readlineThis fixed it for me:
RUBY_CONFIGURE_OPTS=--with-readline-dir="$(brew --prefix readline)" rbenv install 2.6.1OR
Identify location readline and run command export env LDFLAGS like this example
example on my macbook:
export LDFLAGS="-L/Users/tamnguyen/.rbenv/versions/2.6.1/lib -L/usr/local/lib -L/usr/local/Cellar/readline/8.0.0/lib"Enjoy :D