【问题标题】:Failing to build Ruby 2.5.0 with rbenv and ruby-build无法使用 rbenv 和 ruby​​-build 构建 Ruby 2.5.0
【发布时间】: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-on-rails ruby openssl homebrew readline


【解决方案1】:

我升级自制软件后发生此错误。

我花了 2 天时间试图修复这个错误,基本上重新安装了所有东西。这就是我找到解决方案的方式(TL;TR,我太笨了)

  1. brew doctor
  2. 它说“您的 Xcode 版本太旧,您使用的是 9.0,最新的是 10.0”
  3. 我去了应用商店,打开更新选项卡,那里什么也没有
  4. 搜索了 Xcode,发现版本 10 可用
  5. 安装后打开 Xcode
  6. 运行rbenv install 2.5.0 并工作。
  7. 讨厌我的存在。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-07-20
    • 2020-01-21
    • 1970-01-01
    • 1970-01-01
    • 2022-11-06
    • 2015-03-24
    • 1970-01-01
    相关资源
    最近更新 更多