rust 安装添加代理

~/.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"

 

再添加环境变量

 sudo nano  ~/.bash_profile

内容为

export RUSTUP_DIST_SERVER=https://mirrors.ustc.cn/rust-static

export RUSTUP_UPDATE_ROOT=https://mirrors.ustc.cn/tust-static/rustup

如果安装过程中出现各种安装问题 请删除  以上设置

 

以下是原先的方法,不推荐使用
步骤如下:
1. 打开Powershell(注意不是cmd)
2. 输入以下文本
 1    $proxy='http://127.0.0.1:1080'
 2     $ENV:HTTP_PROXY=$proxy
 3       $ENV:HTTPS_PROXY=$proxy
 
 
.\rustup-init.exe

proxy为代理地址
---------------------

 

如果你使用 Linux 或 macOS,打开终端并输入如下命令:

$ curl https://sh.rustup.rs -sSf | sh

更新rustup
rustup self update
更新rust编译器最新的nightly版本
rust update nightly
安装RLS 标准化 编译器增强工具

rustup component add rls --toolchain nightly
rustup component add rust-analysis --toolchain nightly
rustup component add rust-src --toolchain nightly



(Optional) Set RUST_SRC_PATH environment variable to point to the 'src' dir in the Rust source installation e.g. 

 % export RUST_SRC_PATH=/usr/local/src/rust/src 

            or

   % export RUST_SRC_PATH="$(rustc --print sysroot)/lib/rustlib/src/rust/src"

It's recommended to set RUST_SRC_PATH for speed up, but racer detects it automatically if you don't set it.

 



转载于:https://www.cnblogs.com/a208606/p/9929400.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值