繁体   English   中英

Ruby“无法加载 OpenSSL”错误 macOS Sierra

[英]Ruby 'Could not load OpenSSL' error macOS Sierra

我今天刚下载了 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.

出现了。

你能帮我弄清楚这一点吗? 我一直在谷歌和这里到处寻找可能的帮助,但似乎没有任何效果。 我已经尝试了rvm pkg install openssl命令并重新安装了 Ruby,但无济于事。 谢谢!

如果您使用的是 RVM,则可以使用:

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

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM