]>
Commit | Line | Data |
---|---|---|
1a4d82fc JJ |
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 | |
5 | Linux or a Mac, all you need to do is this (note that you don't need to type | |
6 | in the `$`s, they just indicate the start of each command): | |
7 | ||
8 | ```bash | |
c34b1796 | 9 | $ curl -sf -L https://static.rust-lang.org/rustup.sh | sudo sh |
1a4d82fc JJ |
10 | ``` |
11 | ||
12 | If you're concerned about the [potential insecurity](http://curlpipesh.tumblr.com/) of using `curl | sudo sh`, | |
13 | please keep reading and see our disclaimer below. And feel free to use a two-step version of the installation and examine our installation script: | |
14 | ||
15 | ```bash | |
c34b1796 | 16 | $ curl -f -L https://static.rust-lang.org/rustup.sh -O |
1a4d82fc JJ |
17 | $ sudo sh rustup.sh |
18 | ``` | |
19 | ||
20 | If you're on Windows, please download either the [32-bit | |
21 | installer](https://static.rust-lang.org/dist/rust-nightly-i686-pc-windows-gnu.exe) | |
22 | or the [64-bit | |
23 | installer](https://static.rust-lang.org/dist/rust-nightly-x86_64-pc-windows-gnu.exe) | |
24 | and run it. | |
25 | ||
26 | If you decide you don't want Rust anymore, we'll be a bit sad, but that's okay. | |
85aaf69f SL |
27 | Not every programming language is great for everyone. Just run the uninstall |
28 | script: | |
1a4d82fc JJ |
29 | |
30 | ```bash | |
85aaf69f | 31 | $ sudo /usr/local/lib/rustlib/uninstall.sh |
1a4d82fc JJ |
32 | ``` |
33 | ||
34 | If you used the Windows installer, just re-run the `.exe` and it will give you | |
35 | an uninstall option. | |
36 | ||
37 | You can re-run this script any time you want to update Rust. Which, at this | |
38 | point, is often. Rust is still pre-1.0, and so people assume that you're using | |
39 | a very recent Rust. | |
40 | ||
41 | This brings me to one other point: some people, and somewhat rightfully so, get | |
42 | very upset when we tell you to `curl | sudo sh`. And they should be! Basically, | |
43 | when you do this, you are trusting that the good people who maintain Rust | |
44 | aren't going to hack your computer and do bad things. That's a good instinct! | |
45 | If you're one of those people, please check out the documentation on [building | |
46 | Rust from Source](https://github.com/rust-lang/rust#building-from-source), or | |
47 | [the official binary downloads](http://www.rust-lang.org/install.html). And we | |
48 | promise that this method will not be the way to install Rust forever: it's just | |
49 | the easiest way to keep people updated while Rust is in its alpha state. | |
50 | ||
51 | Oh, we should also mention the officially supported platforms: | |
52 | ||
53 | * Windows (7, 8, Server 2008 R2) | |
54 | * Linux (2.6.18 or later, various distributions), x86 and x86-64 | |
55 | * OSX 10.7 (Lion) or greater, x86 and x86-64 | |
56 | ||
57 | We extensively test Rust on these platforms, and a few others, too, like | |
58 | Android. But these are the ones most likely to work, as they have the most | |
59 | testing. | |
60 | ||
61 | Finally, a comment about Windows. Rust considers Windows to be a first-class | |
62 | platform upon release, but if we're honest, the Windows experience isn't as | |
63 | integrated as the Linux/OS X experience is. We're working on it! If anything | |
64 | does not work, it is a bug. Please let us know if that happens. Each and every | |
65 | commit is tested against Windows just like any other platform. | |
66 | ||
67 | If you've got Rust installed, you can open up a shell, and type this: | |
68 | ||
69 | ```bash | |
70 | $ rustc --version | |
71 | ``` | |
72 | ||
c34b1796 | 73 | You should see the version number, commit hash, commit date and build date: |
1a4d82fc JJ |
74 | |
75 | ```bash | |
c34b1796 | 76 | rustc 1.0.0-nightly (f11f3e7ba 2015-01-04) (built 2015-01-06) |
1a4d82fc JJ |
77 | ``` |
78 | ||
79 | If you did, Rust has been installed successfully! Congrats! | |
80 | ||
c34b1796 AL |
81 | This installer also installs a copy of the documentation locally, so you can |
82 | read it offline. On UNIX systems, `/usr/local/share/doc/rust` is the location. | |
83 | On Windows, it's in a `share/doc` directory, inside wherever you installed Rust | |
84 | to. | |
85 | ||
1a4d82fc JJ |
86 | If not, there are a number of places where you can get help. The easiest is |
87 | [the #rust IRC channel on irc.mozilla.org](irc://irc.mozilla.org/#rust), which | |
88 | you can access through | |
89 | [Mibbit](http://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust). Click | |
90 | that link, and you'll be chatting with other Rustaceans (a silly nickname we | |
85aaf69f SL |
91 | call ourselves), and we can help you out. Other great resources include [the |
92 | /r/rust subreddit](http://www.reddit.com/r/rust), and [Stack | |
1a4d82fc | 93 | Overflow](http://stackoverflow.com/questions/tagged/rust). |