简体   繁体   English

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

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

I just downloaded Ruby, Git, Rails, and Homebrew today.我今天刚下载了 Ruby、Git、Rails 和 Homebrew。 I installed ruby via rvm v. 1.29.0 My Ruby is version 2.4.0, Rails is 5.0.1.我通过 rvm v. 1.29.0 安装了 ruby​​ 我的 Ruby 是 2.4.0 版,Rails 是 5.0.1。 My macOS is 10.12 Sierra.我的 macOS 是 10.12 Sierra。

When I tried to make a test app by doing rails new test_app it gave me an error:当我尝试通过执行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`

So I tried a bundle install command, in which the same error所以我尝试了一个 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.

appeared.出现了。

Could you help me figure this one out?你能帮我弄清楚这一点吗? I've been looking everywhere on Google and here for possible help, but nothing seems to be working.我一直在谷歌和这里到处寻找可能的帮助,但似乎没有任何效果。 I've tried the rvm pkg install openssl command and reinstalled Ruby, but to no avail.我已经尝试了rvm pkg install openssl命令并重新安装了 Ruby,但无济于事。 Thanks!谢谢!

If you are using RVM, you can use:如果您使用的是 RVM,则可以使用:

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

to install your version of ruby with OpenSSL .使用OpenSSL安装您的 ruby​​ 版本。 This should allow your bundle to connect to Gemservers over https .这应该允许您的包通过https连接到 Gemservers。

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

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