简体   繁体   English

无法在OSX上安装OpenSSL gem

[英]Can't install OpenSSL gem on OSX

I'm trying to install the OpenSSL gem as follows: 我正在尝试如下安装OpenSSL gem:

sudo gem install openssl -- --with-openssl-dir=/usr/local/opt/openssl sudo gem install openssl---with-openssl-dir = / usr / local / opt / openssl

However, I get the following error 但是,出现以下错误

Building native extensions with: '-with-openssl-dir=/usr/local/opt/openssl'
This could take a while...
ERROR:  Error installing openssl:
    ERROR: Failed to build gem native extension.

    current directory: /Library/Ruby/Gems/2.3.0/gems/openssl-2.1.0/ext/openssl
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby -r ./siteconf20180501-55786-16tbndt.rb extconf.rb -with-openssl-dir=/usr/local/opt/openssl
checking for t_open() in -lnsl... no
checking for socket() in -lsocket... no
checking for openssl/ssl.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
    --with-opt-dir
    --without-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/$(RUBY_BASE_NAME)
    --with-openssl-dir
    --without-openssl-dir
    --with-openssl-include
    --without-openssl-include=${openssl-dir}/include
    --with-openssl-lib
    --without-openssl-lib=${openssl-dir}/lib
    --with-kerberos-dir
    --without-kerberos-dir
    --with-kerberos-include
    --without-kerberos-include=${kerberos-dir}/include
    --with-kerberos-lib
    --without-kerberos-lib=${kerberos-dir}/lib
    --with-debug
    --without-debug
    --enable-debug
    --disable-debug
    --with-nsllib
    --without-nsllib
    --with-socketlib
    --without-socketlib
    --with-openssl-config
    --without-openssl-config
    --with-pkg-config
    --without-pkg-config
extconf.rb:94:in `<main>': OpenSSL library could not be found. You might want to use --with-openssl-dir=<dir> option to specify the prefix where OpenSSL is installed. (RuntimeError)

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /Library/Ruby/Gems/2.3.0/extensions/universal-darwin-17/2.3.0/openssl-2.1.0/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /Library/Ruby/Gems/2.3.0/gems/openssl-2.1.0 for inspection.
Results logged to /Library/Ruby/Gems/2.3.0/extensions/universal-darwin-17/2.3.0/openssl-2.1.0/gem_make.out

It says that it couldn't find OpenSSL. 它说找不到OpenSSL。 However, I specified it as a parameter, yet it is still not picking this up. 但是,我将其指定为参数,但仍然没有选择。 Does anyone have any suggestions? 有没有人有什么建议?

Notably, the error is: 值得注意的是,错误是:

OpenSSL library could not be found. 找不到OpenSSL库。 You might want to use --with-openssl-dir= option to specify the prefix where OpenSSL is installed. 您可能要使用--with-openssl-dir =选项来指定安装OpenSSL的前缀。

Please, can you send the output of ls -l /usr/local/opt/openssl ? 请,您可以发送ls -l /usr/local/opt/openssl吗?

Have you tried installing the latest version of openssl with brew: brew install openssl ? 您是否尝试过使用brew安装最新版本的openssl: brew install openssl

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

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