Install Rust
To install Rust, if you are running Unix,
run the following
in your terminal, then follow the onscreen instructions.
curl https://sh.rustup.rs -sSf | sh
If you are running Windows,
download and run
rustup‑init.exe
then follow the onscreen instructions.
Notes about Rust installation
Toolchain management with rustup
Rust is installed and managed by the
rustup
tool. Rust has a 6-week
rapid release process
and supports a
great number of platforms
, so there are many builds of Rust available at any time.
rustup
manages these builds in a consistent way on every
platform that Rust supports, enabling installation of Rust from the
beta and nightly release channels as well as support for additional
cross-compilation targets.
For more information see the
rustup
documentation.
Configuring the PATH
environment variable
In the Rust development environment, all tools are installed to the
~/.cargo/bin
directory,
and this is where you will find the Rust toolchain, including
rustc
, cargo
, and rustup
.
Accordingly, it is customary for Rust developers to include this
directory in their
PATH
environment variable. During installation rustup
will attempt to configure the
PATH
. Because of differences between platforms,
command shells, and bugs in rustup
, the modifications
to PATH
may not take effect until the console is
restarted, or the user is logged out, or it may not succeed at all.
If, after installation, running rustc --version
in the
console fails, this is the most likely reason.
Windows considerations
On Windows, Rust additionally requires the C++ build tools for Visual Studio 2013 or later. The easiest way to acquire the build tools is by installing Microsoft Visual C++ Build Tools 2017 which provides just the Visual C++ build tools. Alternately, you can install Visual Studio 2017, Visual Studio 2015, or Visual Studio 2013 and during install select the "C++ tools".
For further information about configuring Rust on Windows see the
Windows-specific rustup
documentation.
Other installation methods
The installation described above, via
rustup
, is the preferred way to install Rust for most developers.
However, Rust can be
installed via other methods
as well.