微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

运行 rvm install ruby​​-2.2 时,make.log 发布 make.log 尾部出错

如何解决运行 rvm install ruby​​-2.2 时,make.log 发布 make.log 尾部出错

我正在尝试按照 minitest 在我的 gemfile.lock 中的要求通过 rvm 安装 ruby​​-2.2,但我遇到了如下 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 commandlinetools 然后重新安装它们

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

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。