无法在Mac上安装Ruby 2.3.8版-错误:由于缺少扩展名,Ruby安装被终止

问题描述

我正在尝试将ruby 2.3.8安装到我的Mac中,由于某种原因它失败了。我使用了以下3条命令,所有命令均失败:

RUBY_CONFIGURE_OPTS=--with-openssl-dir=/usr/local/Cellar/openssl/1.0.2t ruby-build 2.3.8 ~/.runtimes/Ruby23x
rbenv install 2.3.8 
ruby-build 2.3.8 ~/.runtimes/Ruby23x

出现以下错误:

Downloading ruby-2.3.8.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.8.tar.bz2
Installing ruby-2.3.8...

WARNING: ruby-2.3.8 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 (Mac OS X 10.14.6 using ruby-build 20200819)

Inspect or clean up the working tree at /var/folders/2_/m7qt44h94f32r5b8ty2dhklh9_hyz8/T/ruby-build.20200820170656.96889.WKDFd5
Results logged to /var/folders/2_/m7qt44h94f32r5b8ty2dhklh9_hyz8/T/ruby-build.20200820170656.96889.log

Last 10 log lines:
To eliminate this warning,please install libyaml and reinstall your ruby.
The Ruby yaml extension was not compiled.
ERROR: Ruby install aborted due to missing extensions
Configure options used:
  --prefix=/Users/dinebhat/.runtimes/Ruby23x
  --with-openssl-dir=/Users/dinebhat/.runtimes/Ruby23x/openssl
  --with-readline-dir=/usr/local/opt/readline
  CC=clang
  LDFLAGS=-L/Users/dinebhat/.runtimes/Ruby23x/lib -L/usr/local/opt/openssl@1.0/lib
  CPPFLAGS=-I/Users/dinebhat/.runtimes/Ruby23x/include -I/usr/local/opt/openssl@1.0/include

您是否尝试了多种操作,我想我已经搞砸了。已安装ruby,openssl,rbenv多次,但似乎无济于事。这是我系统的当前规格,非常感谢您的帮助:

38f9d3570ad8:~ dinebhat$ ruby -version
ruby 2.3.7p456 (2018-03-28 revision 63024) [universal.x86_64-darwin18]
Ignoring RedCloth-4.3.2 because its extensions are not built.  Try: gem pristine RedCloth --version 4.3.2
Ignoring bluecloth-2.2.0 because its extensions are not built.  Try: gem pristine bluecloth --version 2.2.0
Ignoring byebug-11.0.1 because its extensions are not built.  Try: gem pristine byebug --version 11.0.1
Ignoring childprocess-1.0.1 because its extensions are not built.  Try: gem pristine childprocess --version 1.0.1
Ignoring curb-0.9.10 because its extensions are not built.  Try: gem pristine curb --version 0.9.10
-e:1:in `<main>': undefined local variable or method `rsion' for main:Object (NameError)
38f9d3570ad8:~ dinebhat$ 
38f9d3570ad8:~ dinebhat$ which ruby
/usr/local/opt/ruby/bin/ruby
38f9d3570ad8:~ dinebhat$ whereis ruby
/usr/bin/ruby
38f9d3570ad8:~ dinebhat$ 
38f9d3570ad8:~ dinebhat$ rbenv versions
* system (set by /Users/dinebhat/.rbenv/version)
38f9d3570ad8:~ dinebhat$ 
38f9d3570ad8:~ dinebhat$ which openssl
/usr/local/opt/openssl@1.0.2t/bin/openssl

谢谢。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...