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

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

相关推荐
Jonathan Star24 分钟前
用Python轻松提取视频音频并去除静音片段
开发语言·python·音视频
Evand J44 分钟前
【自适应粒子滤波MATLAB例程】Sage Husa自适应粒子滤波,用于克服初始Q和R不准确的问题,一维非线性滤波。附下载链接
开发语言·matlab·卡尔曼滤波·自适应滤波·非线性
hd51cc1 小时前
C++ 类的学习(四) 继承
开发语言·c++·学习
紫荆鱼1 小时前
设计模式-命令模式(Command)
c++·后端·设计模式·命令模式
编码追梦人1 小时前
深耕 Rust:核心技术解析、生态实践与高性能开发指南
开发语言·后端·rust
2301_772093562 小时前
KVSTORE_Pain point_tuchuang_ROS2
java·开发语言·1024程序员节
刘火锅2 小时前
Java 17 环境下 EasyPoi 反射访问异常分析与解决方案(ExcelImportUtil.importExcelMore)
java·开发语言·python
朝新_2 小时前
【SpringBoot】详解Maven的操作与配置
java·spring boot·笔记·后端·spring·maven·javaee
西部风情2 小时前
聊聊连续、递增
java·开发语言
蒙娜丽宁2 小时前
Rust 并发编程进阶:线程模型、通道通信与异步任务对比分析
开发语言·网络·rust