zoukankan      html  css  js  c++  java
  • 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.edu.cn/rust-static

    export RUSTUP_UPDATE_ROOT=https://mirrors.ustc.edu.cn/rust-static/rustup
    如果安装过程中出现各种安装问题 请删除  以上设置

    以下是原先的方法,不推荐使用
    步骤如下:
    1. 打开Powershell(注意不是cmd)
    2. 输入以下文本
     1    $proxy='http://127.0.0.1:1080'
     2     $ENV:HTTP_PROXY=$proxy
     3       $ENV:HTTPS_PROXY=$proxy
     
     
    . ustup-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.



  • 相关阅读:
    MySQL监控脚本
    django学习笔记【004】创建带有model的app
    MySQL-group-replication 配置
    MySQL配置文件模板
    Python 正则表达式
    MYSQL的安全模式:sql_safe_updates介绍
    Git branch && Git checkout常见用法
    git rebase和git merge的用法
    Git最牛最全详解
    理解npm run
  • 原文地址:https://www.cnblogs.com/a208606/p/9929400.html
Copyright © 2011-2022 走看看