This repository was archived by the owner on Sep 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 336
Expand file tree
/
Copy pathinstall.html
More file actions
194 lines (161 loc) · 7.1 KB
/
install.html
File metadata and controls
194 lines (161 loc) · 7.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
---
layout: zh-CN/default
title: 安装 · Rust 程序设计语言
---
<h1 class="rustup">安装 Rust</h1>
<div class="row rustup-row">
<div class="col-md-8 instr-column">
<div id="platform-instructions-unix" class="instructions" style="display: none;">
<p>要安装 Rust 时,请在终端中运行以下命令,然后按照屏幕上的提示进行操作。</p>
<pre>curl https://sh.rustup.rs -sSf | sh</pre>
</div>
<div id="platform-instructions-win" class="instructions" style="display: none;">
<p>
安装 Rust:下载并运行
<a href="https://win.rustup.rs">rustup‑init.exe</a>
然后按照屏幕上的说明进行操作
</p>
</div>
<div id="platform-instructions-unknown" class="instructions" style="display: none;">
<!-- unrecognized platform: ask for help -->
<p>无法识别您的平台</p>
<p>
可以运行在 Windows, Linux, Mac OS X, FreeBSD 和 NetBSD 上。
如果您正在这些平台上,并且看到这句话,请您
<a href="https://github.com/rust-lang/rust-www/issues/new">报告问题(issue)</a>,
并且提供以下信息:
</p>
<div>
<div>navigator.platform:(浏览器.平台)</div>
<div id="nav-plat"></div>
<div>navigator.appVersion:(浏览器.版本)</div>
<div id="nav-app"></div>
</div>
<!-- duplicate the default cross-platform instructions -->
<div>
<p>To install Rust, if you are running Unix,<br/>run the following
in your terminal, then follow the onscreen instructions.</p>
<pre>curl https://sh.rustup.rs -sSf | sh</pre>
</div>
<hr/>
<div>
<p>
您正在使用的是 Windows 操作系统<br/>下载并运行
<a href="https://win.rustup.rs">rustup‑init.exe</a>
然后按照屏幕上的说明进行操作。
</p>
</div>
</div>
<div id="platform-instructions-default" class="instructions">
<div>
<p>To install Rust, if you are running Unix,<br/>run the following
in your terminal, then follow the onscreen instructions.</p>
<pre>curl https://sh.rustup.rs -sSf | sh</pre>
</div>
<hr/>
<div>
<p>
您正在使用的是 Windows 操作系统<br/>下载并运行
<a href="https://win.rustup.rs">rustup‑init.exe</a>
然后按照屏幕上的说明进行操作。
</p>
</div>
</div>
</div>
<div class="col-md-4 release-info-column">
<div>
<div class="release-version">Rust <span>{{ site.stable }}</span></div>
<a href="{{ site.stable_blog }}">
<div class="release-date">{{ site.stable_date | date: "%Y 年 %-m 月 %-d日" }}</div>
</a>
<br>
<a id="platform-button" style="display: none;" href="#">
点击或按下 “n” 键更换平台
</a>
</div>
</div>
</div>
<h2>关于 Rust 安装的注意事项</h2>
<div class="row">
<div class="col-md-12">
<h3>使用 <code>rustup</code> 管理工具链</h3>
<p>
Rust 由
<a href="https://github.com/rust-lang-nursery/rustup.rs"><code>rustup</code></a>
工具来安装和管理。 Rust 有一个6周的
<a href="https://github.com/rust-lang/rfcs/blob/master/text/0507-release-channels.md">
快速发布过程
</a> 并且支持
<a href="https://forge.rust-lang.org/platform-support.html">
大量的平台
</a>,所以任何时候都有很多 Rust 构建可用。
<code>rustup</code> 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
</p>
<p>
For more information see the
<a href="https://github.com/rust-lang-nursery/rustup.rs/blob/master/README.md"><code>rustup</code>
documentation</a>.
</p>
<h3>配置 <code>PATH</code> 环境变量</h3>
<p>
在 Rust 开发环境中,所有工具都安装到
<span class="platform-specific not-win" style="display: inline;">
<code>~/.cargo/bin</code>
</span>
<span class="platform-specific win" style="display: none;">
<code>%USERPROFILE%\.cargo\bin</code>
</span> 目录,
并且您能够在这里找到 Rust 工具链,包括
<code>rustc</code>、<code>cargo</code>及<code>rustup</code>。
</p>
<p>
Accordingly, it is customary for Rust developers to include this
directory in their
<a href="https://en.wikipedia.org/wiki/PATH_(variable)"><code>PATH</code>
environment variable</a>. During installation, <code>rustup</code>,
will attempt to configure
<code>PATH</code>, but because of differences between platforms,
command shells, and bugs in <code>rustup</code>, the modifications
to <code>PATH</code> may not take effect until the console is
restarted, or the user logged out, or may not succeed at all.
</p>
<p>
当安装完成之后,如果在控制台运行 <code>rustc --version</code> 失败,这是最可能的原因。
</p>
<div class="platform-specific win">
<h3>Windows 注意事项</h3>
<!-- This anchor is probably linked in the wild and should not be broken -->
<a id="win-foot"></a>
<p>
在 Windows 上, Rust 需要 Visual C++ 生成工具 2013 或更新版本的支持。获取 Visual C++ 生成工具最方便的方法是安装
<a href="http://landinghub.visualstudio.com/visual-cpp-build-tools">
Microsoft Visual C++ Build Tools 2015
</a>
。或者,你可以
<a href="https://www.visualstudio.com/downloads/">安装</a>
Visual Studio 2015 或 Visual Studio 2013 并在安装过程中选择安装 “C++ 工具”。
</p>
<p>
关于在 Windows 上配置 Rust 的更多信息请查看
<a href="https://github.com/rust-lang-nursery/rustup.rs/blob/master/README.md#working-with-rust-on-windows">Windows-specific <code>rustup</code>
文档</a>。
</p>
</div>
</div>
</div>
<h2>其他安装方法</h3>
<div class="row">
<div class="col-md-12">
<p>
上述通过 <code>rustup</code> 的安装方法是大多数开发者的首选。
但是 Rust 也可以
<a href="other-installers.html">通过其他方法安装</a>。
</p>
</div>
</div>
<script type="text/javascript">
{% include rustup.js %}
</script>