簡體   English   中英

無法在OSX上安裝OpenSSL gem

[英]Can't install OpenSSL gem on OSX

我正在嘗試如下安裝OpenSSL gem:

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

但是,出現以下錯誤

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

它說找不到OpenSSL。 但是,我將其指定為參數,但仍然沒有選擇。 有沒有人有什么建議?

值得注意的是,錯誤是:

找不到OpenSSL庫。 您可能要使用--with-openssl-dir =選項來指定安裝OpenSSL的前綴。

請,您可以發送ls -l /usr/local/opt/openssl嗎?

您是否嘗試過使用brew安裝最新版本的openssl: brew install openssl

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM