无法要求 openssl,安装 OpenSSL 并重建 ruby​​(首选)或使用非 HTTPS 源 [英] Unable to require openssl, install OpenSSL and rebuild ruby (preferred) or use non-HTTPS sources

查看:48
本文介绍了无法要求 openssl,安装 OpenSSL 并重建 ruby​​(首选)或使用非 HTTPS 源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试安装 jekyll,但遇到了错误.我正在运行 Mac OS X 10.11.4 (El Capitan).

I'm attempting to install jekyll and I've encountered an error. I'm running Mac OS X 10.11.4 (El Capitan).

$gem install jekyll
ERROR : While executing gem ... (Gem::Exception)
        Unable to require openssl, install OpenSSL and rebuild ruby (preferred) or use non-HTTPS sources
$gem source -l
https://ruby.taobao.org
$which openssl
/usr/local/bin/openssl

欢迎您提出如何解决此错误的建议.

I welcome your suggestions how to resolve this error.

推荐答案

较新版本的 OSX 弃用了 openSSL,导致许多依赖项被破坏.您需要重新安装 ruby​​,但要准确指定 openSSL 库的位置.如果您使用的是 rvm 则如下所示:

Newer versions of OSX deprecated openSSL, leaving many dependencies broken. You need to reinstall ruby, but specify exactly where your openSSL libraries are. If you're using rvm then that looks like:

rvm reinstall 2.3.0 --with-openssl-dir=/usr/local/opt/openssl

如果您使用的是自制软件,那么您的库所在位置的快速快捷方式是:

If you're using homebrew, then a quick shortcut to where your libraries are is:

brew install openssl
rvm reinstall 2.3.0 --with-openssl-dir=`brew --prefix openssl`

这篇关于无法要求 openssl,安装 OpenSSL 并重建 ruby​​(首选)或使用非 HTTPS 源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆