首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >对于使用xcode命令行工具12的ruby版本1.9.3、2.2.0、2.2.5,rbenv / ruby-build安装失败

对于使用xcode命令行工具12的ruby版本1.9.3、2.2.0、2.2.5,rbenv / ruby-build安装失败
EN

Stack Overflow用户
提问于 2020-09-23 21:59:20
回答 2查看 1.3K关注 0票数 1

clang --version为12或更高版本时,低于2.3.1的Ruby版本将无法安装。要重现该问题,请首先通过软件更新获取xcode命令行开发工具版本12,或者擦除mac并安装homebrew:

代码语言:javascript
复制
# homebrew installs version 12 of the command line developer tools as well
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

则此操作将失败:

代码语言:javascript
复制
brew install rbenv
rbenv install 2.2.5

rbenv install 2.2.5的输出:

代码语言:javascript
复制
Downloading openssl-1.0.2u.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/ecd0c6ffb493dd06707d38b14bb4d8c2288bb7033735606569d8f90f89669d16
Installing openssl-1.0.2u...
Installed openssl-1.0.2u to /Users/kburnett/.rbenv/versions/2.2.5

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

WARNING: ruby-2.2.5 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 (Mac OS X 10.15.6 using ruby-build 20200819)

Inspect or clean up the working tree at /var/folders/my/qwq5ncb54svfh_qs70kjh4qc0000gn/T/ruby-build.20200921102602.41313.Eghhn7
Results logged to /var/folders/my/qwq5ncb54svfh_qs70kjh4qc0000gn/T/ruby-build.20200921102602.41313.log

Last 10 log lines:
compiling ../.././ext/psych/yaml/reader.c
compiling ../.././ext/psych/yaml/emitter.c
linking shared-object json/ext/generator.bundle
compiling ../.././ext/psych/yaml/parser.c
installing default psych libraries
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

在显示"Results logged to“的文件中,报告有3个警告和4个错误。错误如下:

代码语言:javascript
复制
 % grep "error:" /var/folders/my/qwq5ncb54svfh_qs70kjh4qc0000gn/T/ruby-build.20200921102602.41313.log
./openssl_missing.h:71:6: error: conflicting types for 'HMAC_CTX_copy'
./openssl_missing.h:95:5: error: conflicting types for 'EVP_CIPHER_CTX_copy'
./openssl_missing.h:173:5: error: conflicting types for 'BN_rand_range'
./openssl_missing.h:177:5: error: conflicting types for 'BN_pseudo_rand_range'

https://gist.github.com/burnettk/04fb637c4ec18f621b2df500dbcec00e的问题要点。

EN

回答 2

Stack Overflow用户

发布于 2020-11-09 21:38:33

Burnettk将Xcode CommandLineTools更改为低于12的版本是正确的,但是没有必要删除/Library/Developer/CommandLineTools,如果您每天使用Xcode,这很可能会在您的环境中导致其他问题。

首先,打开Xcode并转到Preferences > Locations,然后检查Command Line Tools下拉列表中有哪些选项。如果可用,请选择Xcode 11.x,然后重试安装。Locations view with Xcode 11.7 command line tools selected

如果您还没有该版本,请安装https://developer.apple.com/downloads/提供的低于12.0的“命令行工具”的最高版本。完成后,弹回Locations首选项,选择刚刚安装的工具,然后重新安装Ruby。

票数 3
EN

Stack Overflow用户

发布于 2020-09-23 21:59:20

这与Xcode 12版本(2020年9月16日)背道而驰。要“修复”/解决这个问题,如果你已经有了clang --version reporting版本12点的东西,你可以sudo rm -rf /Library/Developer/CommandLineTools,然后去https://developer.apple.com/downloads/,用你的苹果ID登录,找到“Xcode11.5的命令行工具”或类似的东西。一旦clang --version报告了11点的东西,这应该会再次起作用:rbenv install 2.2.5

这个变通方法最初是由https://github.com/rbenv/ruby-build/issues/1353的bfreezy发现的。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64029645

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档