A note on rustup switching rustc versions not working

A note on rustup switching rustc versions not working

Saving streams: homebrew and rustup install rustc conflict, uninstall homebrew installedrustccan be resolved.

sh

brew uninstall rust

Description of the problem

I’m going to try it.tauriDeveloping a mobile app, the startup is stuck at the first steprustcIncorrect version issue.

After installing rustup according to the official documentation, refer to the online experience Rust.Managing rustc versions with rustup

sh

curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh

Installing and setting up the stable version

sh

rustup install stable 
 
rustup default stable

strangely enoughrustup toolchain listIt’s the latest 1.82.0.

runrustc -VStill 1.64.0.

Trying to uninstall this version also prompts that this version does not exist.

sh

rustup toolchain uninstall 1.64.0

settle (a dispute)

After tossing and turning for a while I wondered if I had installed rustc a long time ago in some other way and the above didn’t work as expected.

我用whichChecked where rustc is executing.

sh

which rustc

It was found that its directory was the rustc installed by homebrew, not the rustc installed by rustup.

It dawned on me that there should be a problem with the sequence of environment variables. After uninstalling the previous version of rustc using brew, the rustc location became normal.

sh

brew uninstall rust