Mac에 cargo-edit 설치
carg-edit를 설치하려고하면 다음과 같은 오류가 발생합니다.
$ cargo install cargo-edit
Could not find directory of OpenSSL installation, and this `-sys` crate cannot
proceed without this knowledge. If OpenSSL is installed and this crate had
trouble finding it, you can set the `OPENSSL_DIR` environment variable for the
compilation process.
If you're in a situation where you think the directory *should* be found
automatically, please open a bug at https://github.com/sfackler/rust-openssl
and include information about your system as well as this message.
$HOST = x86_64-apple-darwin
$TARGET = x86_64-apple-darwin
openssl-sys = 0.9.58
It looks like you're compiling on macOS, where the system contains a version of
OpenSSL 0.9.8. This crate no longer supports OpenSSL 0.9.8.
As a consumer of this crate, you can fix this error by using Homebrew to
install the `openssl` package, or as a maintainer you can use the openssl-sys
0.7 crate for support with OpenSSL 0.9.8.
아무래도 OpenSSL 버전이 맞지 않는 것 같습니다. Homebrew에서 openssl을 설치하라고 써 있기 때문에 그렇습니다.
$ brew update
$ brew install openssl
Updating Homebrew...
==> Downloading https://homebrew.bintray.com/bottles/openssl%401.1-1.1.1g.catalina.bottle.tar.gz
==> Downloading from https://d29vzk4ow07wi7.cloudfront.net/1926679569c6af5337de812d86f4dad2b21ff883ad3a5d2cd9e8836ac5ac7ffe?re
######################################################################## 100.0%
==> Pouring [email protected]
==> Caveats
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
/usr/local/etc/[email protected]/certs
and run
/usr/local/opt/[email protected]/bin/c_rehash
[email protected] is keg-only, which means it was not symlinked into /usr/local,
because macOS provides LibreSSL.
If you need to have [email protected] first in your PATH run:
echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.zshrc
For compilers to find [email protected] you may need to set:
export LDFLAGS="-L/usr/local/opt/[email protected]/lib"
export CPPFLAGS="-I/usr/local/opt/[email protected]/include"
==> Summary
🍺 /usr/local/Cellar/[email protected]/1.1.1g: 8,059 files, 18MB
==> `brew cleanup` has not been run in 30 days, running now...
Pruned 1 symbolic links and 2 directories from /usr/local
지시에 따라 중간 인증서를 키체인에 등록합니다.
finder에서/usr/local/etc/오펜 sl @ 1.1/를 엽니다.
cert.pem을 클릭하여 키체인 액세스로 인증서를 등록합니다.
지시대로 다음 명령을 실행합니다.
$ /usr/local/opt/[email protected]/bin/c_rehash
이 상태에서는 MacOS에 들어 있는 LibreSSL이 사용되므로 .zshrc에 OpenSSL을 사용하도록 지정합니다.
$ echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.zshrc
컴파일러가 오펜 sl @ 1.1를 찾으려면 아래 설명이 필요하기 때문에 다음을 추가합니다.
$ vi ~/.zshrc
export LDFLAGS="-L/usr/local/opt/[email protected]/lib"
export CPPFLAGS="-I/usr/local/opt/[email protected]/include"
로드합니다.
$ source ~/.zshrc
이제 cargo-edit를 설치할 수 있습니다.
$ cargo install cargo-edit
(省略)
Installed package `cargo-edit v0.6.0` (executables `cargo-add`, `cargo-rm`, `cargo-upgrade`)
Reference
이 문제에 관하여(Mac에 cargo-edit 설치), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/EilinenTuuli/items/a484b442306c6d86e633텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)