运行rvm install ruby-2.2时,出现make.log的post tail错误



我正在尝试通过rvm安装ruby-2.2,根据minitest在我的gemfile中的要求。但是我遇到了一个错误,如下面的ruby-2.2的make.log尾部所示。

make.log的尾部:

Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 12.0.5 (clang-1205.0.22.11)
Target: arm64-apple-darwin20.5.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
compiling compar.c
. ./vm_opts.h
compiling complex.c
compiling dir.c
compiling dln_find.c
compiling enum.c
compiling encoding.c
compiling enumerator.c
compiling error.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....
+__rvm_make:0> return 2 

当我试图通过rbenv安装它时,它说:

dgram_write in libcrypto.a(bss_dgram.o)
_RAND_query_egd_bytes in libcrypto.a(rand_egd.o)
...
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[4]: *** [link_a.darwin] Error 1
make[3]: *** [do_darwin-shared] Error 2
make[2]: *** [libcrypto.1.0.0.dylib] Error 2
make[1]: *** [shared] Error 2
make: *** [build_crypto] Error 1

使用:

升级openssl
brew upgrade openssl

但它也需要我删除xcode命令行工具,然后重新安装它们

sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install

最新更新