gpt4 book ai didi

ruby-on-rails - ruby 'Could not load OpenSSL' 错误 macOS Sierra

转载 作者:数据小太阳 更新时间:2023-10-29 08:11:13 25 4
gpt4 key购买 nike

我今天刚刚下载了 Ruby、Git、Rails 和 Homebrew。我通过 rvm v. 1.29.0 安装了 ruby我的 Ruby 是 2.4.0 版,Rails 是 5.0.1。我的 macOS 是 10.12 Sierra。

当我试图通过做一个测试应用程序时 rails new test_app它给了我一个错误:

`Could not load OpenSSL.
You must recompile Ruby with OpenSSL support or change the sources in your
Gemfile from 'https' to 'http'. Instructions for compiling with OpenSSL using
RVM are available at rvm.io/packages/openssl.`
run bundle exec spring binstub --all
bundler: command not found: spring
Install missing gem executables with `bundle install`

于是我尝试了一个bundle install命令,同样报错

Could not load OpenSSL.
You must recompile Ruby with OpenSSL support or change the sources in your
Gemfile from 'https' to 'http'. Instructions for compiling with OpenSSL using
RVM are available at rvm.io/packages/openssl.

出现了。

你能帮我解决这个问题吗?我一直在 Google 和此处到处寻找可能的帮助,但似乎没有任何效果。我尝试了 rvm pkg install openssl 命令并重新安装了 Ruby,但无济于事。谢谢!

最佳答案

如果您正在使用 RVM,您可以使用:

rvm install "<ruby-version>" --with-openssl-dir=`brew --prefix openssl`

使用 OpenSSL 安装您的 ruby​​ 版本。这应该允许您的包通过 https 连接到 Gemservers。

关于ruby-on-rails - ruby 'Could not load OpenSSL' 错误 macOS Sierra,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42286082/

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