首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >在装有rbenv的Mac上安装ruby2.0.0-p195时出现OpenSSL错误

在装有rbenv的Mac上安装ruby2.0.0-p195时出现OpenSSL错误
EN

Stack Overflow用户
提问于 2013-06-19 08:21:54
回答 3查看 15.8K关注 0票数 15

我试图在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

有什么想法吗?

EN

回答 3

Stack Overflow用户

发布于 2014-07-22 08:15:07

我通过执行以下命令修复了这个问题:

brew link openssl --force

Mac OSX 10.9.4

票数 8
EN

Stack Overflow用户

发布于 2013-07-04 16:04:59

升级到最新版本的ruby-build为我解决了这个问题:

就像行动一样,我得到了

BUILD FAILED

Inspect or clean up the working tree at /Users/me/.rbenv/sources/2.0.0-p247
Results logged to /var/folders/3x/y_8y8vr53ws_kxj97km79q5h0000gn/T/ruby-build.20130704172404.3106.log

Last 10 log lines:
installing default gems:      /Users/me/.rbenv/versions/2.0.0-p247/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?

但是要安装最新版本的ruby-build,请通过

# Don't forget brew doctor and brew update if required
brew upgrade ruby-build

修好了。

ruby-build在OP请求时和现在之间有了一些变化,这可以解释为什么它适用于我,但不适用于使用最新稳定版本的Ruby-build的OP。

票数 6
EN

Stack Overflow用户

发布于 2014-10-06 21:32:11

使用ruby-install的解决方案:

在卸载和安装openssl几次(可能没有必要)之后,我成功地尝试了以下操作:

ruby-install ruby 2.1.3 -- --with-openssl-dir=`brew --prefix openssl`
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/17181075

复制
相关文章

相似问题

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