rCore_tutorial_doc icon indicating copy to clipboard operation
rCore_tutorial_doc copied to clipboard

安装 nightly rust · GitBook

Open wyfcyx opened this issue 5 years ago • 4 comments

https://wyfcyx.github.io/rCore_tutorial_doc/chapter1/part1.html

wyfcyx avatar Dec 06 '19 04:12 wyfcyx

安装 rustc nightly可以有更简洁的方法

chyyuu avatar Dec 09 '19 00:12 chyyuu

如果下载速度太慢可以使用tuna镜像,具体操作 https://mirrors.tuna.tsinghua.edu.cn/help/rustup/ 上写的挺清楚的

cht33 avatar Feb 18 '20 14:02 cht33

@cht33 如果下载速度太慢可以使用tuna镜像,具体操作 https://mirrors.tuna.tsinghua.edu.cn/help/rustup/ 上写的挺清楚的

这样做似乎在安装 Rustup 的过程中没有帮助。 建议使用在终端使用科学上网,输入以下命令:

export https_proxy=http://127.0.0.1:1080
export http_proxy=http://127.0.0.1:1080
export ftp_proxy=http://127.0.0.1:1080

随后测试是否成功:

curl -v www.google.com

之后,在使用 Rustup 的 tuna 镜像的同时,我们还需要使用 crate.io 的 utsc 镜像,做法如下: 新建文件 ~/.cargo/config,在里面输入如下内容:

[source.crates-io]
registry = "https://github.com/rust-lang/crates.io-index"
replace-with = 'ustc'
[source.ustc]
registry = "git://mirrors.ustc.edu.cn/crates.io-index"

这样能解决之后的很多网络问题。

wyfcyx avatar Feb 18 '20 15:02 wyfcyx

@wyfcyx

@cht33 如果下载速度太慢可以使用tuna镜像,具体操作 https://mirrors.tuna.tsinghua.edu.cn/help/rustup/ 上写的挺清楚的

这样做似乎在安装 Rustup 的过程中没有帮助。 建议使用在终端使用科学上网,输入以下命令:

export https_proxy=http://127.0.0.1:1080
export http_proxy=http://127.0.0.1:1080
export ftp_proxy=http://127.0.0.1:1080

随后测试是否成功:

curl -v www.google.com

之后,在使用 Rustup 的 tuna 镜像的同时,我们还需要使用 crate.io 的 utsc 镜像,做法如下: 新建文件 ~/.cargo/config,在里面输入如下内容:

[source.crates-io]
registry = "https://github.com/rust-lang/crates.io-index"
replace-with = 'ustc'
[source.ustc]
registry = "git://mirrors.ustc.edu.cn/crates.io-index"

这样能解决之后的很多网络问题。

嗯对的,我看到第二章的时候也在cargo的配置文件中用了ustc的镜像。 对于本节的初始安装rust工具链,一种不用科学上网的安装方式是设置rustup也使用ustc镜像。 具体我是这样做的:

export RUSTUP_DIST_SERVER=https://mirrors.ustc.edu.cn/rust-static
export RUSTUP_UPDATE_ROOT=https://mirrors.ustc.edu.cn/rust-static/rustup
curl https://sh.rustup.rs -sSf | sh

cht33 avatar Feb 18 '20 15:02 cht33