rustup gives command not found error with zsh even after installing with brew

Rohith Joseph picture Rohith Joseph · May 23, 2021 · Viewed 7k times · Source

I installed rustup with brew command but still says that rustup command is not found. I am not sure if I am missing any installation step. Any help would be appreciated.

Answer

lAaravl picture lAaravl · Aug 2, 2021

I used the following steps to install Rust on MacOS:

  1. 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.

  2. Once successfully done, then add the Path variable to .zshrc using:

    • To open .zhrc use nano ~/.zshrc
    • Add export PATH="$HOME/.cargo/bin:$PATH" to .zhrc
  3. Check if the installation was successfull using rustc --version

All the best! :)