【发布时间】:2018-07-23 03:53:08
【问题描述】:
所以我正在尝试使用 rbenv 安装 ruby 2.5.0,这是我的问题:
$ rbenv install 2.5.0
ruby-build: use openssl from homebrew
Downloading ruby-2.5.0.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.5/ruby-2.5.0.tar.bz2
Installing ruby-2.5.0...
ruby-build: use readline from homebrew
BUILD FAILED (OS X 10.13.3 using ruby-build 20171226-3-g01e7b7b)
Inspect or clean up the working tree at /var/folders/6d/p9mv033d1xv9hc4xbdr7fxf40000gp/T/ruby-build.20180212121818.63339
Results logged to /var/folders/6d/p9mv033d1xv9hc4xbdr7fxf40000gp/T/ruby-build.20180212121818.63339.log
Last 10 log lines:
installing capi-docs:
/Users/lukeholloway/.rbenv/versions/2.5.0/share/doc/ruby
The Ruby OpenSSL extension was not compiled.
ERROR: Ruby install aborted due to missing extensions
Configure options used:
--prefix=/Users/lukeholloway/.rbenv/versions/2.5.0
--with-openssl-dir=/usr/local/opt/openssl
--with-readline-dir=/usr/local/opt/readline
CC=clang
LDFLAGS=-L/Users/lukeholloway/.rbenv/versions/2.5.0/lib
CPPFLAGS=-I/Users/lukeholloway/.rbenv/versions/2.5.0/include
问题似乎在于 OpenSSL 的 mac 版本和 Homebrew 版本之间的路径。我在我的 Mac 上使用 Homebrew 来做所有的事情,仅供参考。
这是我的 openssl 文件夹:
$ which openssl
/usr/local/opt/openssl/bin/openssl
$ openssl version
OpenSSL 1.0.2n 7 Dec 2017
我的.bash_profile 中有这一行,以使其使用随 Homebrew 安装的较新版本:
export PATH="/usr/local/opt/openssl/bin:$PATH"
现在似乎正在加载正确的 OpenSSL 版本,但仍然无法正确编译。它适用于任何版本的 ruby。
有谁知道具体是怎么回事?任何帮助都会很棒!
【问题讨论】:
-
基于
ruby-build: use readline from homebrew后跟BUILD FAILED,你安装ReadLine了吗?如果我没记错的话,OpenSSL 不使用 ReadLine 但 Homebrew 工具可以。 -
作为建议;我会确保 Homebrew 已经更新,并且您还拥有最新版本的 Xcode 命令行工具。我在这样做时遇到了一些错误,但使用 RVM
标签: ruby-on-rails ruby openssl homebrew readline