错误:无法为 `openssl v0.9.24` 运行自定义构建命令。

11

我想在我的系统(Linux Mint)上安装cargo-apk cargo install cargo-apk,但是我遇到了以下错误

error: failed to run custom build command for `openssl v0.9.24`

Caused by:
  process didn't exit successfully: `/tmp/cargo-install7N44TO/release/build/openssl-65bb03053b1fc095/build-script-build` (exit code: 101)
--- stderr
thread 'main' panicked at 'Unable to detect OpenSSL version', /home/jiri/.cargo/registry/src/github.com-1ecc6299db9ec823/openssl-0.9.24/build.rs:16:14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

warning: build failed, waiting for other jobs to finish...
error: failed to compile `cargo-apk v0.4.0`, intermediate artifacts can be found at `/tmp/cargo-install7N44TO`

Caused by:
  build failed

我发现我需要安装libssl-dev,然后我就安装了,但是并没有起到帮助作用。

2个回答

6

Rust的openssl-sys库需要安装OpenSSL。

在Windows上: 首先从此处下载并安装OpenSSL: http://slproweb.com/products/Win32OpenSSL.html

then set this EnvironmentVariable:

在Windows上:

set OPENSSL_DIR=C:\Program Files\OpenSSL-Win64\

在Linux上:

sudo apt-get install pkg-config libssl-dev

或者

sudo pacman -S openssl

或者

sudo dnf install openssl-devel

或者

curl -O https://www.openssl.org/source/openssl-1.1.0f.tar.gz tar xf

openssl-1.1.0f.tar.gz cd openssl-1.1.0f export CC=... ./Configure

--prefix=... linux-x86_64 -fPIC make -j$(nproc) make install

在OSX上:

xcode-select --install

brew install openssl


我已经安装了OpenSSL,但仍然遇到了构建错误。 - alexzander
@alexzander 你的操作系统是什么?你的 PATH 中是否有 OpenSSL? - ben
那我需要将 /usr/bin/openssl 放入 $PATH 中吗?这样应该就可以解决问题了吧? - alexzander
@alexzander 你应该试一试,我认为它可以。 - ben

0

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接