gpt4 book ai didi

Ruby 安装 (2.2.2) 在 macOS Big Sur 中失败

转载 作者:行者123 更新时间:2023-12-04 11:51:45 25 4
gpt4 key购买 nike

我在 macOS Big Sur 上安装 Ruby 2.2.2 时遇到了一些麻烦。有没有人遇到过他们能够解决的类似问题?非常感谢🙏
错误:

`Downloading openssl-1.0.2u.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/ecd0c6ffb493dd06707d38b14bb4d8c2288bb7033735606569d8f90f89669d16
Installing openssl-1.0.2u...
Installed openssl-1.0.2u to /Users/findum/.rbenv/versions/2.2.2

Downloading ruby-2.2.2.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.2.tar.bz2
Installing ruby-2.2.2...

WARNING: ruby-2.2.2 is past its end of life and is now unsupported.
It no longer receives bug fixes or critical security updates.

ruby-build: using readline from homebrew

BUILD FAILED (macOS 11.1 using ruby-build 20201225)

Inspect or clean up the working tree at /var/folders/x8/g8yqvrh55gq0wds4hny1t94r0000gn/T/ruby-build.20210101111906.42540.uFRvAN
Results logged to /var/folders/x8/g8yqvrh55gq0wds4hny1t94r0000gn/T/ruby-build.20210101111906.42540.log

Last 10 log lines:
compiling ../.././ext/psych/yaml/parser.c
linking shared-object json/ext/parser.bundle
linking shared-object pathname.bundle
installing default psych libraries
linking shared-object json/ext/generator.bundle
linking shared-object bigdecimal.bundle
linking shared-object psych.bundle
linking shared-object nkf.bundle
linking shared-object date_core.bundle
make: *** [build-ext] Error 2`

最佳答案

编辑
看起来 OP 编辑​​了原始消息中的错误,因此以下答案不再相关。留给子孙后代吧。

更新答案
基于对 rbenv repo 的几个 Github 问题的讨论,

  • https://github.com/rbenv/ruby-build/issues/1480
  • https://github.com/rbenv/ruby-build/issues/1489

  • 听起来 Apple 更改了默认设置 CFLAGS作为 xcode 12 的一部分,这使得一些 native 扩展安装变得困惑。听起来这些问题中提出的解决方案是
    CFLAGS="-Wno-error=implicit-function-declaration" rbenv install 2.2.2

    原答案
    该错误指出由于扩展问题而失败
    The Ruby readline extension was not compiled.
    The Ruby zlib extension was not compiled.
    ERROR: Ruby install aborted due to missing extensions
    所以我建议先尝试手动安装这些扩展,然后重试 ruby​​ 安装。
    随着 brew :
    brew install readline
    brew install zlib
    ruby-build上有一些问题的 github 也可能有帮助:
  • https://github.com/rbenv/ruby-build/issues/1076
  • https://github.com/rbenv/ruby-build/issues/832#issuecomment-160906530
  • 关于Ruby 安装 (2.2.2) 在 macOS Big Sur 中失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65524323/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com