我无法在 MacBook Pro(16 英寸,2019 年)上安装 ruby 2.1.2。我遇到以下问题
Downloading ruby-2.1.2.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.2.tar.bz2
Installing ruby-2.1.2...
WARNING: ruby-2.1.2 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 (macOS 11.2.3 using ruby-build 20210309)
Inspect or clean up the working tree at /var/folders/m8/2rpyp98n6kn0f5628315l8jr0000gn/T/ruby-build.20210319190843.1296.BVeODj
Results logged to /var/folders/m8/2rpyp98n6kn0f5628315l8jr0000gn/T/ruby-build.20210319190843.1296.log
Last 10 log lines:
installing capi-docs: /Users/shodhangk/.rbenv/versions/2.1.2/share/doc/ruby
The Ruby openssl extension was not compiled.
ERROR: Ruby install aborted due to missing extensions
Configure options used:
--prefix=/Users/shodhangk/.rbenv/versions/2.1.2
--with-openssl-dir=/usr/local/opt/openssl@1.1
--with-readline-dir=/usr/local/opt/readline
CC=clang
LDFLAGS=-L/Users/shodhangk/.rbenv/versions/2.1.2/lib
CPPFLAGS=-I/Users/shodhangk/.rbenv/versions/2.1.2/include
我查看了此 Ruby installation (2.2.2) fails in macOS Big Sur 并尝试了以下所有解决方案,但仍然存在相同的问题。
RUBY_CONFIGURE_OPTS=--with-openssl-dir=/usr/local/Cellar/openssl@1.0/1.0.2t rbenv install 2.1.2
CFLAGS="-Wno-error=implicit-function-declaration" rbenv install 2.1.2
甚至尝试将 ruby 版本稍微更改为 2.1.x 和 2.2.x。但没有区别。