To install Rust, you can follow different guides. This one follow official Rust website guide.
- Documentation: https://www.rust-lang.org
- Install guide: https://www.rust-lang.org/tools/install
Install Rust binaries
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Update your PATH, like with .zshrc
echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> ~/.zshrc
Source your PATH
source ~/.zshrc
And execute cargo
to check if Rust setup is available.
cargo
Example:
Rust's package manager
Usage: cargo [+toolchain] [OPTIONS] [COMMAND]
cargo [+toolchain] [OPTIONS] -Zscript <MANIFEST_RS> [ARGS]...
You can use rustc
to check version
rustc -vV
Example:
rustc 1.77.2 (25ef9e3d8 2024-04-09)
binary: rustc
commit-hash: 25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04
commit-date: 2024-04-09
host: aarch64-apple-darwin
release: 1.77.2
LLVM version: 17.0.6