'error: failed to run custom build command for `openssl v0.9.24`
I want to install cargo-apk cargo install cargo-apk to my system (Linux Mint), but I'm getting this error
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
I found that I should install libssl-dev, so I did, but it didn't help.
Solution 1:[1]
rust openssl-sys library needs openssl installed.
then on Windows : download and install it from here first : http://slproweb.com/products/Win32OpenSSL.html
then set this EnvironmentVariable:
set OPENSSL_DIR=C:\Program Files\OpenSSL-Win64\
on linux :
sudo apt-get install pkg-config libssl-dev
or
sudo pacman -S openssl
or
sudo dnf install openssl-devel
or
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
and in osx just :
xcode-select --install
brew install openssl
Solution 2:[2]
I faced similar issue in Windows. Steps I did to resolve the issue.
- Install cygwin - https://www.cygwin.com/
- Install perl(from cygwin bash terminal) - https://learn.perl.org/installing/windows.html
- Then tried cargo install from cygwin bash terminal.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | benyamin |
| Solution 2 | Manoj Mohandas |
