VS Code 配置 Rust-Analyzer 报错

报错信息:

Bootstrap Error" rust-analyzer requires glibc >= 2.28 in latest build.

参考了好多地方,

https://github.com/rust-lang/rust-analyzer/issues/11558

https://blog.csdn.net/aLingYun/article/details/120923694

https://rust-analyzer.github.io/manual.html#vs-code

内容:

Summary of a workaround

the last working build: 0.2.948

the first broken build: 0.2.956

who is affected: anyone running Ubuntu < v.20
Option 1 - downgrade

1.Open the extension page in VS Code

  1. Click on [V] next to Uninstall button

  2. Select 0.2.948 and reload
    Notes

You will be perpetually stuck on that version.
Option 2 - use pre-prelease via rustup

Install rust-analyzer-preview by running rustup toolchain install nightly --component rust-analyzer-preview

Go to VSCode settings and search for rust-analyzer.server.path. You should see something along these lines

image

Click on Edit in settings.json and add "rust-analyzer.server.path": "~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/rust-analyzer"

Reload VSCode
Notes

You will have to update the extension manually with rustup update

Even if rust-analyzer is built using nightly you can still use stable as your default channel

Component availability: https://rust-lang.github.io/rustup-components-history/

是把rust-analyzer 安装上了,但设置路径这一步一直不起效果。

最后偷梁换柱的方式成功了,用自己下载rust-analyzer 替换了VSCode 的 rust-analyzer ,成功了。

bash 复制代码
 $  ln -s ~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/rust-analyzer ~/.vscode-server/extensions/rust-lang.rust-analyzer-0.3.1566-linux-x64/server/rust-analyzer

后面发现,其实是应该该这里的文件 🤦‍。同样起作用。

相关推荐
小码哥_常8 小时前
Spring Boot 牵手Spring AI,玩转DeepSeek大模型
后端
0xDevNull8 小时前
Java反射机制深度解析:从原理到实战
java·开发语言·后端
小小亮018 小时前
Next.js基础
开发语言·前端·javascript
华洛8 小时前
我用AI做了一个48秒的真人精品漫剧,不难也不贵
前端·javascript·后端
ALex_zry8 小时前
C++网络编程心跳机制与连接保活:长连接稳定性保障
开发语言·网络·c++
WZTTMoon8 小时前
Spring Boot 中Servlet、Filter、Listener 四种注册方式全解析
spring boot·后端·servlet
standovon9 小时前
Spring Boot整合Redisson的两种方式
java·spring boot·后端
Amumu121389 小时前
Js:正则表达式(二)
开发语言·javascript·正则表达式
Sgf2279 小时前
ES8(ES2017)新特性完整指南
开发语言·javascript·ecmascript
Cosolar9 小时前
LlamaIndex RAG 本地部署+API服务,快速搭建一个知识库检索助手
后端·openai·ai编程