DEV Community

Yannis Rizos
Yannis Rizos

Posted on

Installing Rust on macOS with Homebrew

This Sunday, I had a bit of extra time, so I decided to brush up on Rust. Whether you are a seasoned developer or just starting out, getting your tools set up is always the first step.

While Rust’s official installation tool, rustup, is excellent and versatile, I prefer using Homebrew whenever possible. It is simple, familiar, and keeps everything neatly managed in one place.

Step 1: Install Rust

Launch the terminal and run the following command to install Rust:

brew install rust
Enter fullscreen mode Exit fullscreen mode

This will install both Rust and Cargo, Rust’s package manager and build system. Cargo simplifies managing dependencies, building projects, and running tests in Rust. It is an essential tool for any Rust developer.

Step 2: Verify the Installation

After installation, confirm everything is set up correctly by checking the Rust version:

rustc --version
cargo --version
Enter fullscreen mode Exit fullscreen mode

If the command returns the Rust version number, you are all set!

Step 3: Keeping Rust Updated

Homebrew makes it easy to update Rust when new versions are released. Periodically run the following commands to keep Rust up to date:

brew update
brew upgrade rust
Enter fullscreen mode Exit fullscreen mode

That is it, you are ready to code in Rust! 🎉

Top comments (0)