Skip to content

Instantly share code, notes, and snippets.

@ewilan-riviere
Last active April 28, 2024 08:36
Show Gist options
  • Save ewilan-riviere/6a0b8aab2e347164e73feab83c862e99 to your computer and use it in GitHub Desktop.
Save ewilan-riviere/6a0b8aab2e347164e73feab83c862e99 to your computer and use it in GitHub Desktop.
How to install Rust

Rust setup

To install Rust, you can follow different guides. This one follow official Rust website guide.

Linux / macOS

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment