gpt4 book ai didi

ruby - 使用 rbenv 在 Mac 上安装 ruby​​ 2.0.0-p195 时出现 OpenSSL 错误

转载 作者:数据小太阳 更新时间:2023-10-29 06:36:05 27 4
gpt4 key购买 nike

我尝试在 Mac (Mountain Lion) 上使用 rbenv 安装 Ruby 2.0.0-p195 并遇到此错误。

BUILD FAILED

Inspect or clean up the working tree at /var/folders/vt/27n8h2yj27v7rzq58075f3_m0000gn/T/ruby-build.20130618163859.1669
Results logged to /var/folders/vt/27n8h2yj27v7rzq58075f3_m0000gn/T/ruby-build.20130618163859.1669.log

Last 10 log lines:
installing default gems: /Users/me/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0 (build_info, cache, doc, gems, specifications)
bigdecimal 1.2.0
io-console 0.4.2
json 1.7.7
minitest 4.3.2
psych 2.0.0
rake 0.9.6
rdoc 4.0.0
test-unit 2.0.0.0
The Ruby openssl extension was not compiled. Missing the OpenSSL lib?

当我运行 brew install openssl 时它说

Warning: openssl-1.0.1e already installed

关注此线程上的解决方案 https://github.com/sstephenson/ruby-build/issues/305我尝试以这种方式安装最新的稳定版并得到了同样的错误

env CFLAGS='-g -O2' RUBY_CONFIGURE_OPTS="--with-readline-dir=`brew --prefix readline`" rbenv install 2.0.0-p195

有什么想法吗?

最佳答案

尝试使用 --with-openssl-dir 选项将 OpenSSL 添加到配置选项:

$ CONFIGURE_OPTS="--with-openssl-dir=`brew --prefix openssl`" rbenv install 2.0.0-p195

如果您使用的是 Homebrew,则需要在运行上述命令之前安装 OpenSSL:

$ brew install openssl

更新 (请参阅下面@JarkkoLaine 的评论):

Just for the record, you should not need to use the config opts anymore with ruby-build and homebrew. However, I had to reinstall openssl with homebrew to make it work: brew uninstall openssl; brew upgrade; brew install openssl; rbenv install 2.0.0-p247. See this for more info.

关于ruby - 使用 rbenv 在 Mac 上安装 ruby​​ 2.0.0-p195 时出现 OpenSSL 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17181075/

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