% ruby-build --version
ruby-build 20160111
% rbenv --version
rbenv 1.0.0
Failed
% rbenv install 2.2.4
Downloading ruby-2.2.4.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.4.tar.bz2
Installing ruby-2.2.4...
BUILD FAILED (OS X 10.11.3 using ruby-build 20160111)
Inspect or clean up the working tree at /var/folders/z7/t9d8k5cx4gnf5mz4zmy1ytj40000gn/T/ruby-build.20160209184944.17951
Results logged to /var/folders/z7/t9d8k5cx4gnf5mz4zmy1ytj40000gn/T/ruby-build.20160209184944.17951.log
Last 10 log lines:
The Ruby readline extension was not compiled.
ERROR: Ruby install aborted due to missing extensions
Configure options used:
--prefix=/Users/kn/.rbenv/versions/2.2.4
--with-openssl-dir=/usr/local/opt/openssl
--with-readline-dir=/usr/local/opt/readline
CC=clang
CFLAGS= -O3 -Wno-error=shorten-64-to-32
LDFLAGS=-L/Users/kn/.rbenv/versions/2.2.4/lib
CPPFLAGS=-I/Users/kn/.rbenv/versions/2.2.4/include
Succeeded
~ % brew link readline --force
Linking /usr/local/Cellar/readline/6.3.8... 18 symlinks created
~ % export CFLAGS=-Wno-error=shorten-64-to-32
~ % CONFIGURE_OPTS="--with-readline-dir=/usr/local --with-openssl-dir=`brew --prefix openssl`" RUBY_CONFIGURE_OPTS="--with-openssl-dir=`brew --prefix openssl`" rbenv install 2.2.4
Downloading ruby-2.2.4.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.4.tar.bz2
Installing ruby-2.2.4...
Installed ruby-2.2.4 to /Users/kn/.rbenv/versions/2.2.4
~ % brew unlink readline
Unlinking /usr/local/Cellar/readline/6.3.8... 18 symlinks removed
~ % rbenv versions
system
2.1.0
* 2.1.4 (set by /Users/kn/.rbenv/version)
2.2.4
Try running
apt-get install -y libreadline-dev
Then try and run
rbenv install 2.2.4