1. Rust官网下载rustup-init.exe
  2. 执行rustup install stable,可通过rustup install -h查看命令信息。

可能会报错,根据错误信息搜索解决方式。

常见错误

  1. 安装rust老是报错:could not download file from 'https://static.rust-lang.org/dist/channel-rus,主要是网站被墙导致,解决方式:
    $proxy='http://<IP>:<PORT>'
    $ENV:HTTP_PROXY=$proxy 
    $ENV:HTTPS_PROXY=$proxy
    cd ~\Downloads\
    .\rustup-init.exe
    

    主要是需要设置HTTPS,之前这只了HTTP也一样报错。

参考文档

  1. Rust 安装与配置国内代理与镜像地址的方法参考