无法在 macOs 13.2.1 (22D68) on intel i7 2019 model 上更新 ruby 版本

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

我已经尝试了至少 10 种方法来将 ruby 安装/更新到至少 2.7.6 的较新版本,但到目前为止还没有成功。我对红宝石的经验为零。请帮助

我尝试使用自制软件、rvm、rbenv frum 等安装它。 总是以这个错误结束:

在 enc 下制作 src 初始头文件错误: 在 /var/folders/s_/1yp2b6hj1z14nmx2g31dl3gr0000gn/T/20230224-83651-xeut39.c:1 包含的文件中: /var/folders/s_/1yp2b6hj1z14nmx2g31dl3gr0000gn/T/20230224-83651-jc45np.h:5930:66: 致命错误:预期标识符或'(' pthread_override_qos_class_end_np(pthread_override_t __override);#pragma clang assume_nonnull end ^ 产生 1 个错误。 make: *** [.ext/include/x86_64-darwin22/rb_mjit_min_header-2.7.5.h] 错误 1 make: *** 等待未完成的工作.... make[1]: 没有什么可以为 `srcs' 做的。

**以下是有错误的日志文件:

/var/folders/s_/1yp2b6hj1z14nmx2g31dl3gr0000gn/T/ruby-build.20230224175237.75587.o0df3h ~ /var/folders/s_/1yp2b6hj1z14nmx2g31dl3gr0000gn/T/ruby-build.20230224175237.75587.o0df3h/ruby-2.7.5 /var/folders/s_/1yp2b6hj1z14nmx2g31dl3gr0000gn/T/ruby-build.20230224175237.75587.o0df3h ~ 检查红宝石... /usr/bin/ruby ...

... 检查 make 是否是 GNU make... 是的 .ext/include/x86_

64-darwin22/ruby/config.h updated
configure: ruby library version = 2.7.0
configure: creating ./config.status
config.status: creating GNUmakefile
config.status: creating Makefile
config.status: creating ruby-2.7.pc**
---
Configuration summary for ruby version 2.7.5

   * Installation prefix: /Users/sumeet/.rbenv/versions/2.7.5
   * exec prefix:         ${prefix}
   * arch:                x86_64-darwin22
   * site arch:           ${arch}
   * RUBY_BASE_NAME:      ruby
   * enable shared:       yes
   * ruby lib prefix:     ${libdir}/${RUBY_BASE_NAME}
   * site libraries path: ${rubylibprefix}/${sitearch}
   * vendor path:         ${rubylibprefix}/vendor_ruby
   * target OS:           darwin22
   * compiler:            clang
   * with pthread:        yes
   * with coroutine:      amd64
   * enable shared libs:  yes
   * dynamic library ext: bundle
   * CFLAGS:              ${optflags} ${debugflags} ${warnflags}
   * LDFLAGS:             -L. -L/Users/sumeet/.rbenv/versions/2.7.5/lib  \
                          -fstack-protector-strong -L/usr/local/lib
   * DLDFLAGS:            -L/Users/sumeet/.rbenv/versions/2.7.5/lib  \
                          -Wl,-multiply_defined,suppress
   * optflags:            -O3
   * debugflags:          -ggdb3
   * warnflags:           -Wall -Wextra -Wdeprecated-declarations \
                          -Wdivision-by-zero \
                          -Wimplicit-function-declaration -Wimplicit-int \
                          -Wmisleading-indentation -Wpointer-arith \
                          -Wshorten-64-to-32 -Wwrite-strings \
                          -Wmissing-noreturn -Wno-cast-function-type \
                          -Wno-constant-logical-operand -Wno-long-long \
                          -Wno-missing-field-initializers \
                          -Wno-overlength-strings -Wno-parentheses-equality \
                          -Wno-self-assign -Wno-tautological-compare \
                          -Wno-unused-parameter -Wno-unused-value \
                          -Wunused-variable -Wextra-tokens
   * strip command:       strip -A -n
   * install doc:         rdoc
   * JIT support:         yes
   * man page type:       doc
   * BASERUBY -v:         ruby 2.6.10p210 (2022-04-12 revision 67958) \
                          [universal.x86_64-darwin22]

---
    BASERUBY = /usr/bin/ruby --disable=gems
    CC = clang
    LD = ld
    LDSHARED = clang -dynamiclib
    CFLAGS = -g -O2 -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/x86_64-darwin22 -I./include -I. -I./enc/unicode/12.1.0
    CPPFLAGS = -I/Users/sumeet/.rbenv/versions/2.7.5/include  -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   
    DLDFLAGS = -L/Users/sumeet/.rbenv/versions/2.7.5/lib  -Wl,-multiply_defined,suppress -install_name /Users/sumeet/.rbenv/versions/2.7.5/lib/libruby.2.7.dylib -compatibility_version 2.7 -current_version 2.7.5  -fstack-protector-strong -framework Security -framework Foundation  -fstack-protector-strong -framework Security -framework Foundation  
    SOLIBS = -lpthread -lgmp -ldl -lobjc
    LANG = en_US.UTF-8
    LC_ALL = en_US.UTF-8
    LC_CTYPE = UTF-8
    MFLAGS = - --jobserver-fds=7,8 -j
Apple clang version 13.0.0 (https://github.com/apple/llvm-project.git 597c04db307f4ed6e19ba0676d791f5c384b62ac)
Target: x86_64-apple-darwin22.3.0
Thread model: posix
InstalledDir: /Library/Developer/Toolchains/swift-5.7-DEVELOPMENT-SNAPSHOT-2022-10-03-a.xctoolchain/usr/bin
compiling ./main.c
compiling dmydln.c
compiling miniinit.c
compiling dmyext.c
translating probes probes.d
compiling ast.c
compiling bignum.c
compiling class.c
compiling compar.c
compiling compile.c
compiling complex.c
compiling cont.c
compiling debug.c
. ./vm_opts.h
compiling debug_counter.c
compiling dir.c
compiling dln_find.c
In file included from cont.c:16:
./mjit.h:131:17: warning: cast to smaller integer type 'enum rb_mjit_iseq_func' from 'mjit_func_t' (aka 'unsigned long (*)(struct rb_execution_context_struct *, struct rb_control_frame_struct *)') [-Wpointer-to-enum-cast]
        switch ((enum rb_mjit_iseq_func)func) {
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
compiling encoding.c
compiling enum.c
compiling enumerator.c
compiling error.c
compiling eval.c
compiling file.c
In file included from eval.c:20:
./mjit.h:131:17: warning: cast to smaller integer type 'enum rb_mjit_iseq_func' from 'mjit_func_t' (aka 'unsigned long (*)(struct rb_execution_context_struct *, struct rb_control_frame_struct *)') [-Wpointer-to-enum-cast]
        switch ((enum rb_mjit_iseq_func)func) {
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
compiling gc.c
In file included from gc.c:41:
./mjit.h:131:17: warning: cast to smaller integer type 'enum rb_mjit_iseq_func' from 'mjit_func_t' (aka 'unsigned long (*)(struct rb_execution_context_struct *, struct rb_control_frame_struct *)') [-Wpointer-to-enum-cast]
        switch ((enum rb_mjit_iseq_func)func) {
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
compiling hash.c
compiling inits.c
compiling io.c
compiling iseq.c
compiling load.c
1 warning generated.
compiling marshal.c
In file included from iseq.c:30:
./mjit.h:131:17: warning: cast to smaller integer type 'enum rb_mjit_iseq_func' from 'mjit_func_t' (aka 'unsigned long (*)(struct rb_execution_context_struct *, struct rb_control_frame_struct *)') [-Wpointer-to-enum-cast]
        switch ((enum rb_mjit_iseq_func)func) {
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
compiling math.c
making mjit_config.h
compiling mjit_compile.c
In file included from mjit_compile.c:19:
./mjit.h:131:17: warning: cast to smaller integer type 'enum rb_mjit_iseq_func' from 'mjit_func_t' (aka 'unsigned long (*)(struct rb_execution_context_struct *, struct rb_control_frame_struct *)') [-Wpointer-to-enum-cast]
        switch ((enum rb_mjit_iseq_func)func) {
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
compiling node.c
compiling numeric.c
compiling object.c
compiling pack.c
compiling parse.c
compiling proc.c
1 warning generated.
compiling process.c
compiling random.c
compiling range.c
compiling rational.c
compiling re.c
compiling regcomp.c
compiling regenc.c
compiling regerror.c
compiling regexec.c
compiling regparse.c
compiling regsyntax.c
compiling ruby.c
1 warning generated.
compiling safe.c
1 warning generated.
compiling signal.c
compiling sprintf.c
In file included from ruby.c:55:
./mjit.h:131:17: warning: cast to smaller integer type 'enum rb_mjit_iseq_func' from 'mjit_func_t' (aka 'unsigned long (*)(struct rb_execution_context_struct *, struct rb_control_frame_struct *)') [-Wpointer-to-enum-cast]
        switch ((enum rb_mjit_iseq_func)func) {
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
compiling st.c
compiling strftime.c
compiling string.c
compiling struct.c
compiling symbol.c
compiling thread.c
1 warning generated.
compiling time.c
In file included from thread.c:77:
./mjit.h:131:17: warning: cast to smaller integer type 'enum rb_mjit_iseq_func' from 'mjit_func_t' (aka 'unsigned long (*)(struct rb_execution_context_struct *, struct rb_control_frame_struct *)') [-Wpointer-to-enum-cast]
        switch ((enum rb_mjit_iseq_func)func) {
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
compiling transcode.c
compiling transient_heap.c
compiling util.c
compiling variable.c
compiling vm.c
In file included from vm.c:341:
./mjit.h:131:17: warning: cast to smaller integer type 'enum rb_mjit_iseq_func' from 'mjit_func_t' (aka 'unsigned long (*)(struct rb_execution_context_struct *, struct rb_control_frame_struct *)') [-Wpointer-to-enum-cast]
        switch ((enum rb_mjit_iseq_func)func) {
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
compiling vm_backtrace.c
In file included from vm.c:350:
./vm_method.c:291:32: warning: cast to smaller integer type 'enum method_optimized_type' from 'void *' [-Wvoid-pointer-to-enum-cast]
            def->body.optimize_type = (enum method_optimized_type)opts;
                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compiling vm_dump.c
compiling vm_trace.c
compiling ./missing/explicit_bzero.c
In file included from vm_trace.c:28:
./mjit.h:131:17: warning: cast to smaller integer type 'enum rb_mjit_iseq_func' from 'mjit_func_t' (aka 'unsigned long (*)(struct rb_execution_context_struct *, struct rb_control_frame_struct *)') [-Wpointer-to-enum-cast]
        switch ((enum rb_mjit_iseq_func)func) {
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
compiling ./missing/setproctitle.c
compiling addr2line.c
compiling dmyenc.c
compiling dln.c
compiling localeinit.c
compiling array.c
compiling mjit.c
array.c:290:17: warning: expression result unused [-Wunused-value]
                RB_OBJ_WRITE(buff_owner_ary, &ptr[i+beg], argv[i]);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./internal.h:2711:34: note: expanded from macro 'RB_OBJ_WRITE'
#define RB_OBJ_WRITE(a, slot, b) UNALIGNED_MEMBER_ACCESS(rb_obj_write((VALUE)(a), (VALUE *)(slot), (VALUE)(b), __FILE__, __LINE__))
                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./internal.h:2703:5: note: expanded from macro 'UNALIGNED_MEMBER_ACCESS'
    unaligned_member_access_result; \
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/ruby/ruby.h:1087:5: note: expanded from macro 'RARRAY_PTR_USE_TRANSIENT'
    expr; \
    ^~~~
assembling coroutine/amd64/Context.S
config.status: creating ruby-runner.h
compiling enc/ascii.c
compiling enc/us_ascii.c
In file included from mjit.c:18:
In file included from ./mjit_worker.c:76:
./mjit.h:131:17: warning: cast to smaller integer type 'enum rb_mjit_iseq_func' from 'mjit_func_t' (aka 'unsigned long (*)(struct rb_execution_context_struct *, struct rb_control_frame_struct *)') [-Wpointer-to-enum-cast]
        switch ((enum rb_mjit_iseq_func)func) {
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
compiling enc/unicode.c
compiling enc/utf_8.c
compiling enc/trans/newline.c
array.c:1200:2: warning: expression result unused [-Wunused-value]
        RB_OBJ_WRITE(target_ary, &ptr[idx], item);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./internal.h:2711:34: note: expanded from macro 'RB_OBJ_WRITE'
#define RB_OBJ_WRITE(a, slot, b) UNALIGNED_MEMBER_ACCESS(rb_obj_write((VALUE)(a), (VALUE *)(slot), (VALUE)(b), __FILE__, __LINE__))
                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./internal.h:2703:5: note: expanded from macro 'UNALIGNED_MEMBER_ACCESS'
    unaligned_member_access_result; \
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/ruby/ruby.h:1087:5: note: expanded from macro 'RARRAY_PTR_USE_TRANSIENT'
    expr; \
    ^~~~
1 warning generated.
./revision.h unchanged
compiling version.c
In file included from version.c:15:
./mjit.h:131:17: warning: cast to smaller integer type 'enum rb_mjit_iseq_func' from 'mjit_func_t' (aka 'unsigned long (*)(struct rb_execution_context_struct *, struct rb_control_frame_struct *)') [-Wpointer-to-enum-cast]
        switch ((enum rb_mjit_iseq_func)func) {
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
1 warning generated.
2 warnings generated.
2 warnings generated.
building rb_mjit_header.h
linking miniruby
rb_mjit_header.h updated
generating encdb.h
building .ext/include/x86_64-darwin22/rb_mjit_min_header-2.7.5.h
./miniruby -I./lib -I. -I.ext/common  ./tool/transform_mjit_header.rb "clang  -g -O2 -fno-common -pipe " rb_mjit_header.h .ext/include/x86_64-darwin22/rb_mjit_min_header-2.7.5.h
compiling builtin.c
encdb.h updated
./tool/ifchange "--timestamp=.rbconfig.time" rbconfig.rb rbconfig.tmp
rbconfig.rb updated
generating enc.mk
creating verconf.h
verconf.h updated
compiling loadpath.c
making srcs under enc
error in initial header file:
In file included from /var/folders/s_/1yp2b6hj1z14nmx2g31dl3gr0000gn/T/20230224-83651-xeut39.c:1:
/var/folders/s_/1yp2b6hj1z14nmx2g31dl3gr0000gn/T/20230224-83651-jc45np.h:5930:66: fatal error: expected identifier or '('
pthread_override_qos_class_end_np(pthread_override_t __override);#pragma clang assume_nonnull end
                                                                 ^
1 error generated.
make: *** [.ext/include/x86_64-darwin22/rb_mjit_min_header-2.7.5.h] Error 1
make: *** Waiting for unfinished jobs....make[1]: Nothing to be done for `srcs'.



I ran the following command:
 RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix [email protected])" rbenv install 2.7.6

ruby homebrew intel rbenv macos-ventura
© www.soinside.com 2019 - 2024. All rights reserved.