无法使用 CPAN 安装 Net::SSLeay: /bin/sh: x86_64-apple-darwin13.4.0-clang: command not found

Posted

技术标签:

【中文标题】无法使用 CPAN 安装 Net::SSLeay: /bin/sh: x86_64-apple-darwin13.4.0-clang: command not found【英文标题】:Cannot install Net::SSLeay using CPAN: /bin/sh: x86_64-apple-darwin13.4.0-clang: command not found 【发布时间】:2021-02-26 13:53:32 【问题描述】:

我正在尝试使用 CPAN 安装 Net::SSLeay。我正在使用 mac 并安装了 openssl,它给了我错误:/bin/sh: x86_64-apple-darwin13.4.0-clang: command not found。这是在强制安装期间 - 这是整个输出:

cpan[1]> force install Net::SSLeay

Reading '/Users/me/.cpan/Metadata'
  Database was generated on Sat, 14 Nov 2020 21:29:03 GMT
Running install for module 'Net::SSLeay'
Checksum for /Users/me/.cpan/sources/authors/id/C/CH/CHRISN/Net-SSLeay-1.88.tar.gz ok
Scanning cache /Users/me/.cpan/build for sizes
............................................................................DONE
'YAML' not installed, will not store persistent state
Configuring C/CH/CHRISN/Net-SSLeay-1.88.tar.gz with Makefile.PL
Do you want to run external tests?
These tests *will* *fail* if you do not have network connectivity. [n] y
*** Found OpenSSL-1.1.1h installed in /usr/local/opt/openssl
*** Be sure to use the same compiler and options to compile your OpenSSL, perl,
    and Net::SSLeay. Mixing and matching compilers is not supported.
Checking if your kit is complete...
Looks good
Warning (mostly harmless): No library found for -lz
Generating a Unix-style Makefile
Writing Makefile for Net::SSLeay
Writing MYMETA.yml and MYMETA.json
  CHRISN/Net-SSLeay-1.88.tar.gz
  /Users/me/miniconda3/bin/perl Makefile.PL -- OK
Running make for C/CH/CHRISN/Net-SSLeay-1.88.tar.gz
cp lib/Net/SSLeay.pod blib/lib/Net/SSLeay.pod
cp lib/Net/SSLeay/Handle.pm blib/lib/Net/SSLeay/Handle.pm
cp lib/Net/SSLeay.pm blib/lib/Net/SSLeay.pm
AutoSplitting blib/lib/Net/SSLeay.pm (blib/lib/auto/Net/SSLeay)
blib/lib/Net/SSLeay.pm: some names are not unique when truncated to 8 characters:
 directory blib/lib/auto/Net/SSLeay:
  do_https3.al, do_https2.al, do_https4.al, do_https.al truncate to do_https
  do_httpx3.al, do_httpx2.al, do_httpx4.al truncate to do_httpx
  get_https.al, get_https3.al, get_https4.al, get_http.al, get_http3.al, get_http4.al, get_httpx.al, get_httpx3.al, get_httpx4.al truncate to get_http
  head_https.al, head_https3.al, head_https4.al, head_http.al, head_http3.al, head_http4.al, head_httpx.al, head_httpx3.al, head_httpx4.al truncate to head_htt
  post_https.al, post_https3.al, post_https4.al, post_http.al, post_http3.al, post_http4.al, post_httpx.al, post_httpx3.al, post_httpx4.al truncate to post_htt
  put_https.al, put_https3.al, put_https4.al, put_http.al, put_http3.al, put_http4.al, put_httpx.al, put_httpx3.al, put_httpx4.al truncate to put_http
  ssl_read_all.al, ssl_read_until.al, ssl_read_CRLF.al truncate to ssl_read
  ssl_write_all.al, ssl_write_CRLF.al truncate to ssl_writ
  tcp_read_all.al, tcp_read_until.al, tcp_read_CRLF.al truncate to tcp_read
  tcp_write_all.al, tcp_write_CRLF.al truncate to tcp_writ
Running Mkbootstrap for SSLeay ()
chmod 644 "SSLeay.bs"
"/Users/me/miniconda3/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- SSLeay.bs blib/arch/auto/Net/SSLeay/SSLeay.bs 644
"/Users/me/miniconda3/bin/perl" "/Users/me/miniconda3/lib/5.26.2/ExtUtils/xsubpp"  -typemap '/Users/me/miniconda3/lib/5.26.2/ExtUtils/typemap' -typemap '/Users/me/.cpan/build/Net-SSLeay-1.88-2/typemap'  SSLeay.xs > SSLeay.xsc
mv SSLeay.xsc SSLeay.c
x86_64-apple-darwin13.4.0-clang -c  -I"/usr/local/opt/openssl/include" -fno-common -DPERL_DARWIN -no-cpp-precomp -mmacosx-version-min=10.9 -fno-strict-aliasing -pipe -fstack-protector-strong -DPERL_USE_SAFE_PUTENV -O3   -DVERSION=\"1.88\" -DXS_VERSION=\"1.88\" -fPIC --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk "-I/Users/me/miniconda3/lib/5.26.2/darwin-thread-multi-2level/CORE"   SSLeay.c
/bin/sh: x86_64-apple-darwin13.4.0-clang: command not found
make: *** [Makefile:350: SSLeay.o] Error 127
  CHRISN/Net-SSLeay-1.88.tar.gz
  /Users/me/miniconda3/bin/make -- NOT OK
Failed during this command:
 CHRISN/Net-SSLeay-1.88.tar.gz                : make NO

如果我能在安装此模块时获得一些帮助,将不胜感激。其他人在这里遇到过类似的问题,但总是通过安装openssl来解决......我已经这样做了。谢谢。

【问题讨论】:

x86_64-apple-darwin13.4.0-clang: command not found : 什么版本的 macOS?什么版本的perl?什么版本的cc(输入cc --version)? 我在 macOS 10.15.5、perl 版本 5.30.1(与 perlbrew 一起安装)、cc 版本clang-1100.0.33.17 上测试了它,它在这里编译得很好 另请注意评论:*** Found OpenSSL-1.1.1h installed in /usr/local/opt/openssl *** Be sure to use the same compiler and options to compile your OpenSSL, perl, and Net::SSLeay. Mixing and matching compilers is not supported.。所以也许x86_64-apple-darwin13.4.0-clang是你安装openssl时使用的编译器? macOS 10.13.6,Perl v5.26.2,clang-700.1.81。也许我需要更新 cc 您的perl 是使用名为x86_64-apple-darwin13.4.0-clang 的程序编译的,构建模块需要此程序,但在您的路径中找不到该程序。那就是问题所在。通常可以通过安装提供x86_64-apple-darwin13.4.0-clang 的软件包来解决它。但我对苹果产品没有经验 【参考方案1】:

你有一个错误的 perl。 您的 perl -V:cc 配置定义了无效的编译器,因此您无法编译扩展。你需要一个新的 perl,或者修复你定义这个错误编译器的两个 Config 模块。

就像:

sed -i 's,x86_64-apple-darwin13.4.0-clang,gcc,' `perl -V::archlib:`/Config_heavy.pl `perl -V::archlib:`/Config.pm

【讨论】:

以上是关于无法使用 CPAN 安装 Net::SSLeay: /bin/sh: x86_64-apple-darwin13.4.0-clang: command not found的主要内容,如果未能解决你的问题,请参考以下文章

无法使用cpan安装File :: Path库

无法在 Linux 上使用 cpan/cpanm 安装 Net::Pcap

CPAN 无法安装 Algorithm::CurveFit

centos环境下使用CPAN安装perl模块

如何在使用 perlbrew 时安装 CPAN 模块?

修改CPAN安装源