【问题标题】:Unable to install any Ruby binaries in macOS 11.5.2 (BigSur)无法在 macOS 11.5.2 (BigSur) 中安装任何 Ruby 二进制文件
【发布时间】:2021-11-29 15:45:41
【问题描述】:

最近拿到了新的MacBook Pro Apple M1芯片,尝试使用rvm安装ruby 2.5.0但无法成功安装

Error running '__rvm_make -j8'
please read /Users/sridhar/.rvm/log/1633882248_ruby-2.5.0/make.log

There has been an error while running make. Halting the installation.

尝试了许多选项,例如重新安装 RVM、openssl 等其他软件包,但没有成功

安装任何 ruby​​ 版本时都会出现同样的错误

make.log 的输出

+__rvm_make:0> make -j8
    CC = gcc
    LD = ld
    LDSHARED = gcc -dynamiclib
    CFLAGS = -O3 -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wmisleading-indentation -Wextra-tokens   -fno-common -pipe 
    XCFLAGS = -D_FORTIFY_SOURCE=2 -fstack-protector -fno-strict-overflow -fvisibility=hidden -DRUBY_EXPORT
    CPPFLAGS = -I/opt/homebrew/opt/openssl@3/include -I/opt/homebrew/opt/libyaml/include -I/opt/homebrew/opt/libksba/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/zlib/include -I/opt/homebrew/opt/openssl@1.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -I. -I.ext/include/-darwin20 -I./include -I. -I./enc/unicode/10.0.0
    DLDFLAGS = -L/opt/homebrew/opt/openssl@3/lib -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -L/opt/homebrew/opt/libyaml/lib -L/opt/homebrew/opt/libksba/lib -L/opt/homebrew/opt/readline/lib -L/opt/homebrew/opt/zlib/lib -L/opt/homebrew/opt/openssl@1.1/lib -install_name /Users/sridhar/.rvm/rubies/ruby-2.5.0/lib/libruby.2.5.dylib -compatibility_version 2.5 -current_version 2.5.0  -fstack-protector -framework Foundation  -fstack-protector -framework Foundation  
    SOLIBS = -lpthread -ldl -lobjc 
    LANG = 
    LC_ALL = 
    LC_CTYPE = UTF-8
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.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
compiling ./main.c
compiling dmydln.c
compiling miniinit.c
compiling dmyext.c
generating miniprelude.c
translating probes probes.d
compiling bignum.c
executable host ruby is required. use --with-baseruby option.
make: *** [miniprelude.c] Error 1
make: *** Waiting for unfinished jobs....
. ./vm_opts.h
+__rvm_make:0> return 2

【问题讨论】:

  • please read /Users/sridhar/.rvm/log/1633882248_ruby-2.5.0/make.log 那个文件是什么样的?
  • 我有点怀疑2017年发布的程序可能不支持M1(2020年发布)和/或Big Sur(2020年发布)。
  • @spickermann 使用 make.log 的详细信息更新问题

标签: ruby rvm


【解决方案1】:

终于可以使用here提到的这个解决方案了

CFLAGS="-Wno-error=implicit-function-declaration" rvm install 2.5.5

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-01-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多