首页 > 解决方案 > 无法使用 ASDF 安装 ruby

问题描述

我正在尝试使用 ASDF 安装 ruby​​ 2.2.10,但没有成功。我试图自己找出为什么现在会发生这种情况。不确定某些 brew 更新是否会破坏它或什么。

在这里我分享安装的输出:

asdf install
elixir 1.10.2-otp-22 is already installed
elm 0.18.0 is already installed
istioctl 1.4.7 is already installed
Downloading openssl-1.0.2u.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/ecd0c6ffb493dd06707d38b14bb4d8c2288bb7033735606569d8f90f89669d16
Installing openssl-1.0.2u...
Installed openssl-1.0.2u to /Users/murbano/.asdf/installs/ruby/2.2.10

Downloading ruby-2.2.10.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.10.tar.bz2
Installing ruby-2.2.10...

WARNING: ruby-2.2.10 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.15.6 using ruby-build 20200520)

Inspect or clean up the working tree at /var/folders/47/wxs46t2s6db9fh1zv640mpdr0000gn/T/ruby-build.20200921205118.64211.ty44rI
Results logged to /var/folders/47/wxs46t2s6db9fh1zv640mpdr0000gn/T/ruby-build.20200921205118.64211.log

Last 10 log lines:
compiling complex.c
compiling dir.c
compiling dln_find.c
compiling encoding.c
encoding.c:825:2: error: implicit declaration of function 'rb_str_change_terminator_length' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        rb_str_change_terminator_length(obj, oldtermlen, termlen);
        ^
1 error generated.
make: *** [encoding.o] Error 1
make: *** Waiting for unfinished jobs....

还尝试过:

RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl)" asdf install
elixir 1.10.2-otp-22 is already installed
elm 0.18.0 is already installed
istioctl 1.4.7 is already installed
Downloading ruby-2.2.10.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.10.tar.bz2
Installing ruby-2.2.10...

WARNING: ruby-2.2.10 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.15.6 using ruby-build 20200520)

Inspect or clean up the working tree at /var/folders/47/wxs46t2s6db9fh1zv640mpdr0000gn/T/ruby-build.20200921210737.34707.yrr2le
Results logged to /var/folders/47/wxs46t2s6db9fh1zv640mpdr0000gn/T/ruby-build.20200921210737.34707.log

Last 10 log lines:
compiling dln_find.c
compiling encoding.c
compiling enum.c
encoding.c:825:2: error: implicit declaration of function 'rb_str_change_terminator_length' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        rb_str_change_terminator_length(obj, oldtermlen, termlen);
        ^
compiling enumerator.c
1 error generated.
make: *** [encoding.o] Error 1
make: *** Waiting for unfinished jobs....
brew --prefix openssl
/usr/local/opt/openssl@1.1

我安装了 XCode,重新启动,它停止了安装,但我不知道为什么。

这是在卸载 ruby​​ 进行全新的全新安装之后发生的。

标签: rubymacosasdf-vm

解决方案


推荐阅读