问题
Updating crates.io index
warning: spurious network error (2 tries remaining): SSL error: syscall failure: Connection reset by peer; class=Os (2); code=Eof (-20)
warning: spurious network error (1 tries remaining): failed to connect to github.com: Resource temporarily unavailable; class=Os (2)
error: failed to get `rand` as a dependency of package `guessing_name v0.1.0 (/mnt/d/Linux/Desktop/Rust/guessing_name)`
Caused by:
failed to load source for dependency `rand`
Caused by:
Unable to update registry `crates-io`
Caused by:
failed to fetch `https://github.com/rust-lang/crates.io-index`
Caused by:
failed to connect to github.com: Resource temporarily unavailable; class=Os (2)
解决:
删除掉 ~/.cargo/registry/index ;可能是这个目录损坏了
本文解决了Rust项目中使用Cargo构建时遇到的Updating crates.io index错误问题,具体表现为网络连接失败导致无法获取依赖包。解决方案是删除~/.cargo/registry/index目录。
4766

被折叠的 条评论
为什么被折叠?



