I used the following steps to install Rust on MacOS:
-
Install Rust using:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Make sure that you customize the installation and answer No when it asks to modify the Path.
-
Once successfully done, then add the Path variable to .zshrc using:
- To open .zshrc use
nano ~/.zshrc
- Add
export PATH="$HOME/.cargo/bin:$PATH"
to .zshrc
- To open .zshrc use
-
Check if the installation was successfull using
rustc --version
If that doesn’t work right away then use the command:
source $HOME/.cargo/env
and rerunrustc --version
.