]> git.lizzy.rs Git - rust.git/blob - src/doc/trpl/installing-rust.md
Resolve unused_parens compilation warning
[rust.git] / src / doc / trpl / installing-rust.md
1 % Installing Rust
2
3 The first step to using Rust is to install it! There are a number of ways to
4 install Rust, but the easiest is to use the `rustup` script. If we're on Linux
5 or a Mac, all we need to do is this:
6
7 > Note: we don't need to type in the `$`s, they just indicate the start of
8 > each command. We’ll see many tutorials and examples around the web that
9 > follow this convention: `$` for commands run as our regular user, and `#` for
10 > commands we should be running as an administrator.
11
12 ```bash
13 $ curl -sf -L https://static.rust-lang.org/rustup.sh | sh
14 ```
15
16 If we're concerned about the [potential insecurity][insecurity] of using `curl |
17 sh`, please keep reading and see our disclaimer below. And feel free to use a
18 two-step version of the installation and examine our installation script:
19
20 ```bash
21 $ curl -f -L https://static.rust-lang.org/rustup.sh -O
22 $ sh rustup.sh
23 ```
24
25 [insecurity]: http://curlpipesh.tumblr.com
26
27 If you're on Windows, please download the appropriate [installer][install-page].
28
29 > Note: By default, the Windows installer won't add Rust to the %PATH% system
30 > variable. If this is the only version of Rust we are installing and we want to
31 > be able to run it from the command line, click on "Advanced" on the install
32 > dialog and on the "Product Features" page ensure "Add to PATH" is installed on
33 > the local hard drive.
34
35
36 [install-page]: https://www.rust-lang.org/install.html
37
38 ## Uninstalling
39
40 If you decide you don't want Rust anymore, we'll be a bit sad, but that's okay.
41 Not every programming language is great for everyone. We'll just run the
42 uninstall script:
43
44 ```bash
45 $ sudo /usr/local/lib/rustlib/uninstall.sh
46 ```
47
48 If we used the Windows installer, we'll just re-run the `.msi` and it will give
49 us an uninstall option.
50
51 ## That disclaimer we promised
52
53 Some people, and somewhat rightfully so, get very upset when we tell them to
54 `curl | sh`. Basically, when they do this, they are trusting that the good
55 people who maintain Rust aren't going to hack their computer and do bad things.
56 That's a good instinct! If you're one of those people, please check out the
57 documentation on [building Rust from Source][from-source], or [the official
58 binary downloads][install-page].
59
60 [from-source]: https://github.com/rust-lang/rust#building-from-source
61
62 ## Platform support
63
64 Oh, we should also mention the officially supported platforms:
65
66 * Windows (7 or later, Server 2008 R2)
67 * Linux (2.6.18 or later, various distributions), x86 and x86-64
68 * OSX 10.7 (Lion) or later, x86 and x86-64
69
70 We extensively test Rust on these platforms, and a few others, too, like
71 Android. But these are the ones most likely to work, as they have the most
72 testing.
73
74 Finally, a comment about Windows. Rust considers Windows to be a first-class
75 platform upon release, but if we're honest, the Windows experience isn't as
76 integrated as the Linux/OS X experience is. We're working on it! If anything
77 doesn't work, it is a bug. Please let us know if that happens. Each and every
78 commit is tested against Windows just like any other platform.
79
80 ## After installation
81
82 If we've got Rust installed, we can open up a shell, and type this:
83
84 ```bash
85 $ rustc --version
86 ```
87
88 You should see the version number, commit hash, and commit date.
89
90 If you do, Rust has been installed successfully! Congrats!
91
92 If you don't and you're on Windows, check that Rust is in your %PATH% system
93 variable. If it isn't, run the installer again, select "Change" on the "Change,
94 repair, or remove installation" page and ensure "Add to PATH" is installed on
95 the local hard drive.
96
97 This installer also installs a copy of the documentation locally, so we can read
98 it offline. On UNIX systems, `/usr/local/share/doc/rust` is the location. On
99 Windows, it's in a `share/doc` directory, inside the directory to which Rust was
100 installed.
101
102 If not, there are a number of places where we can get help. The easiest is
103 [the #rust IRC channel on irc.mozilla.org][irc], which we can access through
104 [Mibbit][mibbit]. Click that link, and we'll be chatting with other Rustaceans
105 (a silly nickname we call ourselves) who can help us out. Other great resources
106 include [the user’s forum][users], and [Stack Overflow][stackoverflow].
107
108 [irc]: irc://irc.mozilla.org/#rust
109 [mibbit]: http://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust
110 [users]: https://users.rust-lang.org/
111 [stackoverflow]: http://stackoverflow.com/questions/tagged/rust