首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何解决使用vscode时锈蚀箱的“无身份验证”问题?

如何解决使用vscode时锈蚀箱的“无身份验证”问题?
EN

Stack Overflow用户
提问于 2022-10-23 09:40:29
回答 1查看 74关注 0票数 0

在使用货物时,我们非常熟悉以下错误。

代码语言:javascript
复制
[ERROR rust_analyzer::lsp_utils] rust-analyzer failed to load workspace: Failed to read Cargo metadata from Cargo.toml file /Users/calvin/tiflash/raft-engine/Cargo.toml, Some(Version { major: 1, minor: 64, patch: 0, pre: Prerelease("nightly") }): Failed to run `"cargo" "metadata" "--format-version" "1" "--manifest-path" "/Users/calvin/tiflash/raft-engine/Cargo.toml" "--filter-platform" "x86_64-apple-darwin"`: `cargo metadata` exited with an error:     Updating git repository `https://github.com/pingcap/rust-protobuf`
    Updating git repository `https://github.com/tikv/raft-rs`
error: failed to load source for dependency `raft-proto`

Caused by:
  Unable to update https://github.com/tikv/raft-rs?branch=master

Caused by:
  failed to fetch into: /Users/calvin/.cargo/git/db/raft-rs-42b8049ef2e3af07

Caused by:
  failed to authenticate when downloading repository: git@github.com:tikv/raft-rs

  * attempted ssh-agent authentication, but no usernames succeeded: `git`

  if the git CLI succeeds then `net.git-fetch-with-cli` may help here
  https://doc.rust-lang.org/cargo/reference/config.html#netgit-fetch-with-cli

Caused by:
  no authentication available

通过使用以下命令,可以解决问题

代码语言:javascript
复制
eval `ssh-agent -s`
ssh-add

然而,我们如何在使用vscode时做到这一点呢?一种方法是使用命令行启动vscode,但这不是一个很好的解决方案。

我想知道在vscode或生锈分析器插件中是否有一些可以提供帮助的信息。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-10-23 12:58:18

我发现修改~/.cargo/config会有帮助。

代码语言:javascript
复制
[net]
git-fetch-with-cli = true
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/74170084

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档