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

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

相关推荐
杜子不疼.4 分钟前
Python多模态AI开发指南:让AI同时理解文字、图片和语音
开发语言·人工智能·python
IT_陈寒5 分钟前
SpringBoot自动配置的坑把我埋了半小时
前端·人工智能·后端
逻辑驱动的ken8 分钟前
Java高频面试考点04
java·开发语言·算法·哈希算法·散列表
小饕8 分钟前
RAG学习之 - 检索质量评估指标详解:从概念到代码实战
开发语言·人工智能·python·学习
John.Lewis10 分钟前
C++加餐课-继承和多态:扩展学习
开发语言·c++·笔记
XMYX-012 分钟前
12 - Go Slice:底层原理、扩容机制与常见坑位
开发语言·golang
codeejun13 分钟前
每日一Go-50、Go微服务--配置中心
开发语言·微服务·golang
代码漫谈15 分钟前
Spring Boot 配置指南:约定大于配置的应用
java·spring boot·后端
泽020215 分钟前
LLMChat ----- 通过C++语言调用大语言模型所实现的聊天系统
开发语言·c++·语言模型
蒸汽求职17 分钟前
告别静态文档:利用 Notion 搭建“交互式”简历的降维展示策略
开发语言·缓存·面试·职场和发展·金融·notion