Cannot find `cargo` binary on Rust toolchain on Apple M1
Asked Answered
A

2

5

I got this error when I override the rustup toolchain to use the rust-toolchain in the repo directory:

error: the 'cargo' binary, normally provided by the 'cargo' component, is not applicable to the '1.69.0-aarch64-apple-darwin' toolchain

The content of my rustup show:

❯ rustup show
Default host: aarch64-apple-darwin
rustup home:  /Users/myhome/.rustup

installed toolchains
--------------------

stable-aarch64-apple-darwin (default)
stable-x86_64-unknown-linux-gnu
nightly-2022-11-04-aarch64-apple-darwin
1.67.0-aarch64-apple-darwin
1.67.0-x86_64-unknown-linux-gnu
1.67.1-aarch64-apple-darwin
1.68.0-aarch64-apple-darwin
1.69.0-aarch64-apple-darwin

active toolchain
----------------

1.69.0-aarch64-apple-darwin (overridden by '/Users/myhome/myrepo/rust-toolchain')
rustc 1.69.0 (84c898d65 2023-04-16)

The rust-toolchain file:

1.69.0

My Mac:

enter image description here

Does anyone know what happens?

Aut answered 22/5, 2023 at 15:33 Comment(2)
Has this been sorted in the meantime? I've just had a somewhat similar toolchain corruption and what sorted it for me was a rustup toolchain uninstall stable and then a rustup toolchain install stable. Let me know if this is still ongoing.Yoo
Thanks @LeftyGBalogh, uninstalling and reinstalling the toolchain worked for me as well.Aubree
M
8

Could you try these commands:

rustup component remove cargo
rustup component add cargo

Reference: https://github.com/rust-lang/rustup/issues/2704

Magnusson answered 11/8, 2023 at 4:50 Comment(0)
P
2

Try this: rustup component add cargo

Palatalized answered 22/5, 2023 at 16:30 Comment(1)
That is odd if cargo was not installed by rustup initially... is that a bug?Stumper

© 2022 - 2024 — McMap. All rights reserved.