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