Install Rust on macOS

I will introduce you to how to install Rust Lang on macOS

If you want to follow official documents, Look at this url

Install by RustUp

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

Setup environment variables

I used ohmyzsh, so I declared env variables to rust lang’s bin directory like this.

export RUST_BIN=$HOME/.cargo/bin
export PATH=$PATH:$RUST_BIN

And run zshrc file.

source ~/.zshrc
rustc --version
rustc 1.60.0 (7737e0b5c 2022-04-04)

Now, we can use command line interface rust lang on macOS.

← Go home