我的RUST学习——【第一章】 如何在不安装VS的情况下快速安装RUST?

最近想学习一下rust语言,于是打算安装一下。

在windows平台下载好安装包后,一切照常的打开安装包,提示如下:

Rust Visual C++ prerequisites

Rust requires the Microsoft C++ build tools for Visual Studio 2013 or
later, but they don't seem to be installed.

The easiest way to acquire the build tools is by installing Microsoft
Visual C++ Build Tools 2019 which provides just the Visual C++ build
tools:

  https://visualstudio.microsoft.com/visual-cpp-build-tools/

Please ensure the Windows 10 SDK and the English language pack components
are included when installing the Visual C++ Build Tools.

Alternately, you can install Visual Studio 2019, Visual Studio 2017,
Visual Studio 2015, or Visual Studio 2013 and during install select
the "C++ tools":

  https://visualstudio.microsoft.com/downloads/

Install the C++ build tools before proceeding.

If you will be targeting the GNU ABI or otherwise know what you are
doing then it is fine to continue installation without the build
tools, but otherwise, install the C++ build tools before proceeding.

Continue? (y/N)

大致的意思就是说,RUST 是依赖与 Visual Studio的,需要安装里面的windows 10 SDK 部分,大致关系和Flutter 和 Android Studio 比较像。

所以很多人就不得不去下载VS,但是众所周知,VS一下就是好几个G出去了,如果仅仅为了学习RUST而去下载这么多东西是不值得的(因为我实验室的电脑已经很破旧了,已经非常卡了,我不会为了学习rust和影响我日常的使用)。

于是我在Stack Overflow发现了一个很牛逼的方法,只需要下载几百兆的东西即可。

ocanis 在 Stack Overflow 的回答如下:

在这里插入图片描述

替换rustup镜像

在上面下载 rustup toolchain install stable-x86_64-pc-windows-gnu 的时候可以会非常慢,这里可以使用国内镜像

linux
export RUSTUP_DIST_SERVER=https://mirrors.ustc.edu.cn/rust-static
export RUSTUP_UPDATE_ROOT=https://mirrors.ustc.edu.cn/rust-static/rustup
linux
$env:RUSTUP_DIST_SERVER="https://mirrors.ustc.edu.cn/rust-static"
$env:RUSTUP_UPDATE_ROOT="https://mirrors.ustc.edu.cn/rust-static/rustup"
  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值