I am trying to install Ruby on my mac and that too the latest version but having trouble.
The pre-installed ruby on mac is of verion 2.0
however, I need to upgrade the same to latest.
I tried installing ruby with Homebrew
like brew install ruby
but whenever i check the version, it shows me the earlier version only. Refer Terminal screenshot:
Am trying to learn ruby but this thing got me stuck for long.
Have also tried another package manager rbenv
and did rbenv install 2.5.1
but that failed with the following error I have no idea about
The Ruby zlib extension was not compiled.
ERROR: Ruby install aborted due to missing extensions
Configure options used:
--prefix=/Users/vshukla/.rbenv/versions/2.5.1
--with-openssl-dir=/usr/local/opt/openssl
CC=clang
CFLAGS= -O3 -Wno-error=shorten-64-to-32
LDFLAGS=-L/Users/vshukla/.rbenv/versions/2.5.1/lib
CPPFLAGS=-I/Users/vshukla/.rbenv/versions/2.5.1/include
Please guide.