在 macos Monterey 中运行“__rvm_make -j8”时出错

问题描述 投票:0回答:2

我尝试在 MacOS(12.4:apple M2)上使用 RVM 安装 ruby 2.7.0,但出现以下错误并且无法安装所需的 ruby 版本。我已经尝试了互联网上与 openssl 相关的所有可用解决方案,但对我来说没有任何作用,并且也尝试了 rbenv 但没有运气。请帮助我,提前谢谢您。

当前版本:OpenSSL 1.1.1s 2022 年 11 月 1 日

+__rvm_make:0> make -j8
        BASERUBY = /usr/bin/ruby --disable=gems
        CC = gcc
        LD = ld
        LDSHARED = gcc -dynamiclib
        CFLAGS = -O3 -ggdb3 -Wno-error=implicit-function-declaration -std=gnu99  -fno-common -pipe
        XCFLAGS = -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fno-strict-overflow -fvisibility=hidden -DRUBY_EXPORT -DCANONICALIZATION_FOR_MATHN -I. -I.ext/include/-darwin21 -I./include -I. -I./enc/unicode/12.1.0
        CPPFLAGS = -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/[email protected]/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT
        DLDFLAGS = -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/[email protected]/lib -install_name /Users/rashmib/.rvm/rubies/ruby-2.7.0/lib/libruby.2.7.dylib -compatibility_version 2.7 -current_version 2.7.0  -fstack-protector-strong -framework Security -framework Foundation  -fstack-protector-strong -framework Security -framework Foundation
        SOLIBS = -lpthread -ldl -lobjc
        LANG =
        LC_ALL =
        LC_CTYPE = UTF-8
        MFLAGS = - --jobserver-fds=4,5 -j
Apple clang version 14.0.0 (clang-1400.0.29.202)
Target: arm64-apple-darwin21.5.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
compiling ./main.c
compiling dmydln.c
compiling miniinit.c
compiling dmyext.c
translating probes probes.d
compiling bignum.c
compiling class.c
compiling ast.c
. ./vm_opts.h
compiling compar.c
compiling compile.c
compiling complex.c
compiling cont.c
bignum.c:6127:33: warning: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro]
        return rb_num_coerce_bin(x, y, rb_intern("remainder"));
                                       ^~~~~~~~~~~~~~~~~~~~~~
./include/ruby/ruby.h:1847:23: note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                      ^
bignum.c:6127:33: note: '{' token is here
        return rb_num_coerce_bin(x, y, rb_intern("remainder"));
                                       ^~~~~~~~~~~~~~~~~~~~~~
./include/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/ruby/ruby.h:1832:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
    {                                                   \
    ^
bignum.c:6127:33: warning: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro]
return rb_num_coerce_bin(x, y, rb_intern("remainder"));
                                       ^~~~~~~~~~~~~~~~~~~~~~
./include/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/ruby/ruby.h:1837:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
    }
    ^
bignum.c:6127:33: note: ')' token is here
        return rb_num_coerce_bin(x, y, rb_intern("remainder"));
                                       ^~~~~~~~~~~~~~~~~~~~~~
./include/ruby/ruby.h:1847:56: note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                                                       ^
class.c:541:13: warning: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro]

ruby macos openssl rvm
2个回答
1
投票

尝试了很多建议后,以下步骤对我有用

  1. MAC端口安装 https://trac.macports.org/wiki/Migration
  2. 运行
    rvm install 2.7.0 --with-out-ext=fiddle

0
投票

当您收到与 __rvm_make -j4 + mac monterey 相关的错误时,请使用您的 openssl 路径运行以下代码 这对我有用。

export PATH="/usr/local/opt/[email protected]/bin:$PATH"
 export LDFLAGS="-L/usr/local/opt/[email protected]/lib"
 export CPPFLAGS="-I/usr/local/opt/[email protected]/include"
 export PKG_CONFIG_PATH="/usr/local/opt/[email protected]/lib/pkgconfig"

 rvm autolibs disable

 export RUBY_CFLAGS=-DUSE_FFI_CLOSURE_ALLOC
 export optflags="-Wno-error=implicit-function-declaration"

 rvm install 2.7.0 --with-openssl-dir=/usr/local/opt/[email protected]
© www.soinside.com 2019 - 2024. All rights reserved.