• 首页 首页 icon
  • 工具库 工具库 icon
    • IP查询 IP查询 icon
  • 内容库 内容库 icon
    • 快讯库 快讯库 icon
    • 精品库 精品库 icon
    • 问答库 问答库 icon
  • 更多 更多 icon
    • 服务条款 服务条款 icon

Rust error: Unable to update registry `crates-io`

武飞扬头像
augooh
帮助1

报错信息

    Updating crates.io index
error: Unable to update registry `crates-io`

Caused by:
  failed to fetch `https://github.com/rust-lang/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.rust-lang.org/cargo/reference/config.html#netgit-fetch-with-cli

Caused by:
  SSL error: received early EOF; class=Ssl (16); code=Eof (-20)
root@DESKTOP-HNHSVEO:~/kvstore# root@DESKTOP-HNHSVEO:~/kvstore# cargo run --example clapgui
pdating crates.io index
error: -bash: root@DESKTOP-HNHSVEO:~/kvstore#: No such file or directory
Unabroot@DESKTOP-HNHSVEO:~/kvstore#     Updating crates.io index
le to update registry `crates-io`

Caused by:
  failed to fetch `https://github.com/rust-lang/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.rust-lang.org/cargo/reference/config.html#netgit-fetch-with-cli

Caused by:
  SSL error: received early EOF; class=Ssl (16); code=Eof (-20)Updating: command not found
学新通

查找资料后说要更新rustup,使用命令行 rustup update又报错:

rustup: command not found

运行rustup -version也报错:

rustup: command not found

解决方案

  1. 运行命令:
    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  2. 添加路径到系统路径:
    运行命令:nano ~/.bashrc
    打开文件在末行添加export PATH="$HOME/.cargo/bin:$PATH"
    再运行source ~/.bashrc

验证

运行rustup --version
结果rustup 1.25.2 (17db695f1 2023-02-01)

这篇好文章是转载于:学新通技术网

  • 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
  • 本站站名: 学新通技术网
  • 本文地址: /boutique/detail/tanhgkjgck
系列文章
更多 icon
同类精品
更多 icon
继续加载