>> In this video, I'll detail the steps that you
need to follow to set up your development environment,
in order to begin writing Rust code.
I'll be demonstrating how to install Rust and Visual Studio Code.
The recommended way to install Rust is to
use rustup the rust toolchain installer.
You can either find instructions at the
rust-lang.org or head over to
the rustup.rs website to
find the installation instructions for your operating system.
When I visit, rustup.rs,
I see a curl command to run in my terminal
here I am showing the option for a Unix operating system,
which I'm currently using.
Windows Subsystem for Linux users can also use this curl command.
If you're running Windows,
you will see a different option prompting you to
download and run the rustup-init.exe.
Note that for a Windows user,
you'll see another option here,
you won't see this curl command,
by expand and say display all supported operating systems.
I will see options for Windows here, but again,
this should be different for you if you are using Windows.
Note that for Windows users,
you might also need to install that
Visual Studio C++ build tools when prompted.
For more information on this,
you can visit rust-lang.org to find
out how to install the Visual Studio C++ Built Tools.
Heading back over to rustup.rs,
I will press the clipboard icon to copy
the curl command and then head over to
the terminal and paste this command and install rustup now.
Once at the terminal,
I'll paste the command and follow
the onscreen instructions to complete the installation of Rust.
This will take a few minutes,
during installation rustup will try to configure
the path environment variable at HOME/.cargo/.bin,
we're all rust tools are installed.
Once installation is complete,
I will see this command Rust is installed now, great.
I also see a command saying to get started,
you need cargo's bin directory at HOME/.cargo/.bin in your path.
This will be done automatically,
but I might need to close
and reopen my terminal for that to apply.
To confirm it was installed correctly, I can type,
rustup in my terminal and see what output is presented to me.
I noticed that I have the version of rustup here,
as well as different usage commands for how to use rustup.
Additionally, you can confirm and
see which version of rust you have installed
by typing rustc - -version,
and this will print out the version of
Rust along with the command hash and the date.
Note that Rust has
a six week rapid release process
and supports a great number of platforms.
There are many builds of Rust build one any time.
Rust of conveniently manages these builds in
a consistent way on every platform that Rust supports.
If you've installed rustup in the past,
you can update to the latest stable version of
Rust by running the command rustup update.
If you can't remember that that's okay,
you can head over to your terminal and
type rustup to be presented with
a list of usage commands and
help you walk through the update process.
Now that we have Rust,
let's get set up with Visual Studio Code
to write and run Rust programs.
Visual Studio Code is not the only option to write and run code,
but it has the most recommended as it's
free and available on all operating systems.
It also has great features to make it
easy to navigate and organize your projects.
To get started, let's visit
the Visual Studio Code download page in
the browser at code.visualstudio.com/download.
The webpage display logos for Windows, Linux, and Mac.
Select the version that corresponds to your operating system.
For me, I'll go ahead and select Mac.
I get this notice, "Thanks for downloading yes code for Mac."
I also notice the download has started down below.
With each operating system,
you will generally follow the same steps
to download and run the installer.
Follow the prompts to install Visual Studio Code,
and once the installation is complete,
start up the Visual Studio Code application.
With that, your development environment is set up and ready to go.
Now we're ready to write our first program.
[MUSIC]