软件定制开发供应商【Rust】cargo update或者cargo build国内被墙失败解决办法

Cargo build软件定制开发供应商失败解决办法

现象

cargo build 时下载失败(Mac 10.13.4),提示:

error: failed to download from https://crates-io.proxy.ustclug.org/api/v1/crates/actix-codec/0.3.0/download

Caused by:
[56] Failure when receiving data from the peer (Received HTTP code 500 from proxy after CONNECT)

或者提示:
error: failed to download from https://crates-io.proxy.ustclug.org/api/v1/crates/actix-codec/0.3.0/download

Caused by:
[60] Peer certificate cannot be authenticated with given CA certificates (SSL certificate problem: certificate has expired)

或者
Caused by:
failed to load source for dependency actix-cors

Caused by:
Unable to update registry crates-io

Caused by:
failed to update replaced source registry crates-io

Caused by:
failed to fetch https://mirrors.sjtug.sjtu.edu.cn/git/crates.io-index

Caused by:
network failure seems to have happened
if a proxy or similar is necessary net.git-fetch-with-cli may help here
https://doc.-lang.org/cargo/reference/config.html#netgit-fetch-with-cli

Caused by:
[56] Failure when receiving data from the peer (Received HTTP code 500 from proxy after CONNECT); class=Net (12)

解决办法

vi ~/.cargo/config

# 放到 `$HOME/.cargo/config` 文件中[source.crates-io]registry = "https://github.com/rust-lang/crates.io-index"# 替换成你偏好的镜像源replace-with = 'sjtu'#replace-with = 'ustc'# 清华大学[source.tuna]registry = "https://mirrors.tuna.tsinghua.edu.cn/git/crates.io-index.git"# 中国科学技术大学[source.ustc]registry = "git://mirrors.ustc.edu.cn/crates.io-index"# 上海交通大学[source.sjtu]registry = "https://mirrors.sjtug.sjtu.edu.cn/git/crates.io-index"# rustcc社区[source.rustcc]registry = "git://crates.rustcc.cn/crates.io-index"[net]git-fetch-with-cli=true
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26

变为上海交通大学的源,最重要的是 最后net的参数,设置为从git拉取。git不会被墙。

网站建设定制开发 软件系统开发定制 定制软件开发 软件开发定制 定制app开发 app开发定制 app开发定制公司 电商商城定制开发 定制小程序开发 定制开发小程序 客户管理系统开发定制 定制网站 定制开发 crm开发定制 开发公司 小程序开发定制 定制软件 收款定制开发 企业网站定制开发 定制化开发 android系统定制开发 定制小程序开发费用 定制设计 专注app软件定制开发 软件开发定制定制 知名网站建设定制 软件定制开发供应商 应用系统定制开发 软件系统定制开发 企业管理系统定制开发 系统定制开发