在MacOS Big Sur中Ruby安装(2.2.2)失败 [英] Ruby installation (2.2.2) fails in macOS Big Sur

查看:24
本文介绍了在MacOS Big Sur中Ruby安装(2.2.2)失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在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编辑了原始邮件中的错误,因此以下答案不再相关。把它留在这里留给子孙后代。


已更新答案

根据Github中关于rbenv回购的几个问题的讨论,

听起来像是苹果更改了默认的CFLAGS作为Xcode12的一部分,这使得一些本地扩展安装变得混乱。听起来这些问题中提出的解决方案是

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上有一些问题可能也有帮助:

这篇关于在MacOS Big Sur中Ruby安装(2.2.2)失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆