Skip to content

vscode rust-analyzer 提示 Failed to spawn one or more proc-macro servers. #8

@zhangwt-cn

Description

@zhangwt-cn

Mac os 环境下 安装好rust环境,使用vscoderust-analyzer报错

Failed to spawn one or more proc-macro servers.

- cannot find proc-macro-srv, the workspace `/Users/xxxx/vscode/rust/guessing_game` is missing a sysroot

Failed to find sysroot for Cargo.toml file /Users/xxxx/vscode/rust/guessing_game/Cargo.toml. Is rust-src installed? can't load standard library from sysroot

/Users/xxxx/.rustup/toolchains/stable-x86_64-apple-darwin

(discovered via `rustc --print sysroot`)

try installing the Rust source the same way you installed rustc

解决方案

# 安装 rust-src
sudo rustup component add rust-src

vscode 中重启一下rust-analyzer插件之后就能解决。

Metadata

Metadata

Assignees

No one assigned

    Labels

    Mac osMac 相关内容Rust编程语言

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions