安装Ruby 报错 Error running 'requirements_osx_brew_update_system ruby-2.3.1

在macOS 10.12.1上安装Ruby 2.3.1时遇到Homebrew更新错误。错误信息提示需要更新Homebrew并确保`brew update`能正常工作。解决方案包括安装`autoconf`等依赖,以及从homebrew/dupes tap安装`apple-gcc42`后再继续安装Ruby。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

操作系统:macOS 10.12.1

安装Ruby2.3.1报错
具体报错信息如下:
chaorenbuhuifeideMacBook-Air:~ chaorenbuhuifei$ rvm install 2.3.1
Searching for binary rubies, this might take some time.
Found remote file https://rubies.travis-ci.org/osx/10.12/x86_64/ruby-2.3.1.tar.bz2
Checking requirements for osx.
Installing requirements for osx.
Updating system.......
Error running 'requirements_osx_brew_update_system ruby-2.3.1',
showing last 15 lines of /Users/chaorenbuhuifei/.rvm/log/1481424365_ruby-2.3.1/update_system.log
https://github.com/Homebrew/homebrew/wiki/Common-Issues
and make sure `brew update` works before continuing.'
++ rvm_pretty_print stderr
++ case "${rvm_pretty_print_flag:=auto}" in
++ case "${TERM:-dumb}" in
++ case "$1" in
++ [[ -t 2 ]]
++ return 1
++ printf %b 'Failed to update Homebrew, follow instructions here:
https://github.com/Homebrew/homebrew/wiki/Common-Issues
and make sure `brew update` works before continuing.\n'
Failed to update Homebrew, follow instructions here:
https://github.com/Homebrew/homebrew/wiki/Common-Issues
and make sure `brew update` works before continuing.
++ return 1
Requirements installation failed with status: 1.
Error running 'requirements_osx_brew_update_system ruby-2.3.1'

解决方案:
步骤1:
$ brew install autoconf automake libtool pkg-config apple-gcc42 libyaml readline libxml2 libxslt libksba openssl sqlite
此方案会报错
Error: No available formula with the name "apple-gcc42"
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching taps...
This formula was found in a tap:
homebrew/dupes/apple-gcc42
To install it, run:
brew install homebrew/dupes/apple-gcc42
这就是一波未平一波又起,幸运的报错提示明确的给出了此问题的解决方案

步骤2:
$brew install homebrew/dupes/apple-gcc42

然后继续安装即可
$rvm install 2.3.1


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值