再インストールすると、こんなエラーがでた。
ruby-build: using openssl from homebrew
Downloading ruby-2.2.7.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.7.tar.bz2
Installing ruby-2.2.7...
WARNING: ruby-2.2.7 is past its end of life and is now unsupported.
It no longer receives bug fixes or critical security updates.
ruby-build: using readline from homebrew
BUILD FAILED (OS X 10.14.5 using ruby-build 20191004)
Inspect or clean up the working tree at /var/folders/q0/0nfw3bls4z1fs4xd3sb7pkqw0000gn/T/ruby-build.20191017114431.855
Results logged to /var/folders/q0/0nfw3bls4z1fs4xd3sb7pkqw0000gn/T/ruby-build.20191017114431.855.log
Last 10 log lines:
installing capi-docs: /Users/user_name/.rbenv/versions/2.2.7/share/doc/ruby
The Ruby openssl extension was not compiled.
ERROR: Ruby install aborted due to missing extensions
Configure options used:
--prefix=/Users/username/.rbenv/versions/2.2.7
--with-openssl-dir=/usr/local/opt/openssl@1.1
--with-readline-dir=/usr/local/opt/readline
CC=clang
LDFLAGS=-L/Users/user_name/.rbenv/versions/2.2.7/lib -L/usr/local/opt/openssl/lib
CPPFLAGS=-I/Users/user_name/.rbenv/versions/2.2.7/include -I/usr/local/opt/openssl/include
エラーをもとに、下のコマンドを試したところインストールできた。
RUBY_CONFIGURE_OPTS="--with-readline-dir=`brew --prefix readline` --with-openssl-dir=`brew --prefix openssl`" rbenv install 2.2.7