【问题标题】:How to "recompile Ruby with OpenSSL support" using RVM?如何使用 RVM “重新编译支持 OpenSSL 的 Ruby”?
【发布时间】:2020-01-10 11:30:38
【问题描述】:

通过 RVM 安装 Ruby 2.3.8 后,运行 bundle 时出现以下错误:

您必须使用 OpenSSL 支持重新编译 Ruby 或更改 Gemfile 中的源代码

如何使用 OpenSSL 支持重新编译 Ruby?

【问题讨论】:

  • 您是否按照错误消息的提示尝试使用 OpenSSL 支持重新编译 Ruby?
  • 是的,我尝试了多种解决方案,甚至花了一天时间来解决这个问题。但是在花了这么多时间之后,我发现只有以下答案可以作为我案例的解决方案。
  • 抱歉,我没有看到您回答了自己的问题。

标签: ruby macos openssl rvm bundler


【解决方案1】:

我的解决方案:

快跑

1:酿造安装https://raw.githubusercontent.com/Homebrew/homebrew-core/8c9b113bc6812dc74c598c8f860017e42fba8d78/Formula/openssl.rb

2: rvm 安装 2.3 --with-openssl-lib=/usr/local/opt/openssl/lib --with-openssl-include=/usr/local/opt/openssl/包括

(如果 rvm 已安装,请使用 重新安装 而不是安装。)

【讨论】:

【解决方案2】:

适用于 MacOS Mojave 上的 rvm

就我而言,安装程序失败是因为它在新版本的 openssl 中使用了过时的部件。这对我有用:

  1. 转到“homebrew-core”文件夹并取回旧的 openssl gem(1.0.2t)

    cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core
    git show 8b9d6d688f483a0f33fcfc93d433de501b9c3513:Formula/openssl.rb >> Formula/openssl\@1.0.2t.rb
    
  2. 输入文件并将类“Openssl”重命名为“OpensslAT102t”

    brew edit Formula/openssl\@1.0.2t.rb
    
  3. 用 brew 安装它

    brew install openssl@1.0.2t
    
  4. 安装后,强制 rvm 使用已安装的 ssl 版本

    # Install 2.3.8
    rvm install 2.3.8 --disable-binary --with-openssl-dir=`brew --prefix openssl@1.0.2t`
    # Or reinstall
    rvm reinstall 2.3.8 --disable-binary --with-openssl-dir=`brew --prefix openssl@1.0.2t`
    

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-02-19
    • 1970-01-01
    • 2016-06-22
    • 1970-01-01
    • 1970-01-01
    • 2018-05-16
    • 2012-04-19
    • 1970-01-01
    相关资源
    最近更新 更多