人生® 2024-08-15 15:00 采纳率: 100%
浏览 17
已结题

rust 下载不来外部依赖

rust下载不了外部依赖
Blocking waiting for file lock on package cache
    Updating `mirror` index
warning: spurious network error (3 tries remaining): [7] Couldn't connect to server (Failed to connect to 127.0.0.1 port 1087 after 2043 ms: Couldn't connect to server); class=Net (12)
warning: spurious network error (2 tries remaining): [7] Couldn't connect to server (Failed to connect to 127.0.0.1 port 1087 after 2042 ms: Couldn't connect to server); class=Net (12)
warning: spurious network error (1 tries remaining): [7] Couldn't connect to server (Failed to connect to 127.0.0.1 port 1087 after 2049 ms: Couldn't connect to server); class=Net (12)
error: failed to get `rand` as a dependency of package `adder-one v0.1.0 (“lib包”)`

Caused by:
  failed to load source for dependency `rand`

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.tuna.tsinghua.edu.cn/git/crates.io-index.git`

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:
  [7] Couldn't connect to server (Failed to connect to 127.0.0.1 port 1087 after 2036 ms: Couldn't connect to server); class=Net (12)

windows11 使用cargo build 的时候不能正确下发所需要的以来
设置的config.toml文件
[source.crates-io]
replace-with = 'mirror'

[source.mirror]
registry = "https://mirrors.tuna.tsinghua.edu.cn/git/crates.io-index.git"
删除了.package-cache 文件并进行重启电脑还是会提示
这个怎么解决
  • 写回答

4条回答 默认 最新

  • 人生® 2024-08-15 16:27
    关注

    我在搜索这个问题的时候发现一直请求本地的1087端口,我就查了下发现1087端口没有东西。所以一直提示无法连接。所以我找为什么请求这个,最后发现我的git设置了代理回去请求这个端口。然后把这个代理删除就可以正常使用了。

    Couldn't connect to server (Failed to connect to 127.0.0.1 port 1087 after 2043 ms: Couldn't connect to server
    
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论 编辑记录
查看更多回答(3条)

报告相同问题?

问题事件

  • 系统已结题 8月23日
  • 已采纳回答 8月15日
  • 创建了问题 8月15日