Mac openssl未找到/加载失败问题处理

  1. 通过homebrew或者其他方式安装软件时出现错误
  • Error running 'requirements_osx_brew_libs_install openssl'
  • Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib (LoadError)

可能是未安装或者是环境变量问题造成(可以通过终端中输入openssl命令,查看反馈信息来判断)

  1. 重新安装openssl:
  • 移除openssl(移除方式可能会有其他版本存在,建议是通过uninstall卸载所有版本)
    brew remove openssl
  • 卸载所有版本openssl
    brew uninstall --force openssl
  • 安装openssl
    brew install openssl
  1. 配置环境变量
    echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile

  2. 安装成功后输出信息

bogon:~ xxx$ brew install openssl
==> Downloading https://homebrew.bintray.com/bottles/openssl-1.0.2n.high_sierra.
Already downloaded: /Users/guhaijun/Library/Caches/Homebrew/openssl-1.0.2n.high_sierra.bottle.tar.gz
==> Pouring openssl-1.0.2n.high_sierra.bottle.tar.gz
==> Caveats
A CA file has been bootstrapped using certificates from the SystemRoots
keychain. To add additional certificates (e.g. the certificates added in
the System keychain), place .pem files in
  /usr/local/etc/openssl/certs

and run
  /usr/local/opt/openssl/bin/c_rehash

This formula is keg-only, which means it was not symlinked into /usr/local,
because Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries.

If you need to have this software first in your PATH run:
  echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile

For compilers to find this software you may need to set:
    LDFLAGS:  -L/usr/local/opt/openssl/lib
    CPPFLAGS: -I/usr/local/opt/openssl/include
For pkg-config to find this software you may need to set:
    PKG_CONFIG_PATH: /usr/local/opt/openssl/lib/pkgconfig

==> Summary
  /usr/local/Cellar/openssl/1.0.2n: 1,792 files, 12.3MB

你可能感兴趣的:(Mac openssl未找到/加载失败问题处理)