我正在使用 macOS Catalina。我正在尝试通过 rbenv 安装旧版本的 Ruby(1.9.3、2.1.2)。
但是,在尝试安装旧版本时,我不断收到以下错误。 *安装 2.4 或更新版本时没问题。
我已经尝试过
brew install openssl
brew install readline
brew install zlib
以及brew更新。
我已安装并更新了所有内容,但仍然不断出现以下错误。
我也尝试使用配置选项安装
RUBY_CONFIGURE_OPTS="--with-readline-dir=`brew --prefix readline` --with-openssl-dir=`brew --prefix openssl`" rbenv install 2.1.2
请让我知道如何解决这个问题。
ruby-build:使用自制程序中的 readline
构建失败(使用 ruby-build 20201005 的 Mac OS X 10.15.7)
检查或清理工作树
/var/folders/80/ts3rxpm5199g71p1vm4xzydj03b4g3/T/ruby-build.20201113153529.74484.A9uFGC
结果记录到
/var/folders/80/ts3rxpm5199g71p1vm4xzydj03b4g3/T/ruby-build.20201113153529.74484.log
最后 10 行日志:
Ruby openssl 扩展未编译。
Ruby readline 扩展未编译。
Ruby zlib 扩展未编译。
错误:Ruby 安装由于缺少扩展而中止
配置使用的选项:
--prefix=/Users/用户名/.rbenv/versions/2.1.2
--with-openssl-dir=/usr/local/opt/[电子邮件受保护] /cdn-cgi/l/email-protection
--with-readline-dir=/usr/local/opt/readline
CC=叮当声
LDFLAGS=-L/Users/用户名/.rbenv/versions/2.1.2/lib
CPPFLAGS=-I/Users/用户名/.rbenv/versions/2.1.2/include
-
ruby-build https://github.com/rbenv/ruby-build required
clang
11 to install older version of ruby: GitHub comment link https://github.com/rbenv/ruby-build/issues/1353#issuecomment-696490149
- If
clang
已经更新到12了,你需要先核对它:sudo rm -rf /Library/Developer/CommandLineTools
(来源 GitHub 评论 https://github.com/rbenv/ruby-build/issues/1473#issuecomment-696765978)
- 然后,安装Command_Line_Tools_for_Xcode_11.5.dmg for
clang
11 来自Apple 开发者官方网站 https://developer.apple.com/download/more/?=xcode(至少需要免费苹果开发者帐户 https://developer.apple.com/support/account)
- Ensure
openssl
1.0 is picked up while installing older version of ruby
-
ruby-build
安装适当的openssl
, 例如。 2.1.2 构建 https://github.com/rbenv/ruby-build/blob/master/share/ruby-build/2.1.2#L1
-
echo $RUBY_CONFIGURE_OPTS
确保它是空的或设置为使用[email protected] /cdn-cgi/l/email-protection
- If
ruby-build
仍然选择openssl
1.1,那么你可以明确地brew install rbenv/tap/[email protected] /cdn-cgi/l/email-protection
and RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix [email protected] /cdn-cgi/l/email-protection)"
(来源 GitHub 评论 https://github.com/rbenv/ruby-build/issues/1353#issuecomment-573414540)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)