rustup update 升级rust时异常 directory does not exist: ‘share/doc/rust/html‘ 解决方法

最近把原来的老版本rust升级为最新版本, 转悠了半天给我报一个 目录不存在异常而升级失败。

异常信息:

**info:**rolling back changes

**error:**failure removing component 'rust-docs-x86_64-apple-darwin', directory does not exist: 'share/doc/rust/html'

stable-x86_64-apple-darwin update failed - rustc 1.70.0 (90c541806 2023-05-31)

解决方法:

mac系统下rust的安装路径在 ~/.rustup/toolchains/stable-x86_64-apple-darwin , 进入这个目录然后手动创建提示不存在的这个目录 share/doc/rust/html , 然后在重新执行 rustup update 即可

网上其他的解决方法: 重新安装rustc, 命令如下:

bash 复制代码
# 重新安装rustc
rustup component remove rustc

rustup component add rustc


# 重新执行rust更新
rustup update

Rust升级和验证

bash 复制代码
➜  rustup update
info: syncing channel updates for 'stable-x86_64-apple-darwin'
714.8 KiB / 714.8 KiB (100 %)  19.2 KiB/s in 50s ETA:  0s
info: latest update on 2024-03-28, rust version 1.77.1 (7cf61ebde 2024-03-27)
info: downloading component 'rustc'
 54.8 MiB /  54.8 MiB (100 %)  38.4 KiB/s in 31m 29s ETA:  0s     
info: downloading component 'rust-src'
  2.5 MiB /   2.5 MiB (100 %)  51.2 KiB/s in  1m 25s ETA:  0s
info: downloading component 'cargo'
  7.0 MiB /   7.0 MiB (100 %)  22.4 KiB/s in  9m 47s ETA:  0s     
info: downloading component 'clippy'
  2.2 MiB /   2.2 MiB (100 %)  57.6 KiB/s in  1m 38s ETA:  0s
info: downloading component 'rust-docs'
 14.9 MiB /  14.9 MiB (100 %)  20.2 KiB/s in 16m 40s ETA:  0s    
info: downloading component 'rust-std'
 23.6 MiB /  23.6 MiB (100 %)  25.6 KiB/s in 35m 32s ETA:  0s    
info: downloading component 'rustfmt'
  1.8 MiB /   1.8 MiB (100 %)  16.0 KiB/s in  3m 13s ETA:  0s    
info: removing previous version of component 'rustc'
info: removing previous version of component 'rust-src'
info: removing previous version of component 'cargo'
info: removing previous version of component 'clippy'
info: removing previous version of component 'rust-docs'
info: removing previous version of component 'rust-std'
info: removing previous version of component 'rustfmt'
info: installing component 'rustc'
 54.8 MiB /  54.8 MiB (100 %)  10.2 MiB/s in  6s ETA:  0s
info: installing component 'rust-src'
info: installing component 'cargo'
info: installing component 'clippy'
info: installing component 'rust-docs'
 14.9 MiB /  14.9 MiB (100 %)   3.0 MiB/s in  4s ETA:  0s
info: installing component 'rust-std'
 23.6 MiB /  23.6 MiB (100 %)  10.0 MiB/s in  2s ETA:  0s
info: installing component 'rustfmt'

  stable-x86_64-apple-darwin updated - rustc 1.77.1 (7cf61ebde 2024-03-27) (from rustc 1.70.0 (90c541806 2023-05-31))

info: cleaning up downloads & tmp directories
info: self-update is disabled for this build of rustup
info: any updates to rustup will need to be fetched with your system package manager
➜  rustup show
Default host: x86_64-apple-darwin
rustup home:  ~/.rustup

stable-x86_64-apple-darwin (default)
rustc 1.77.1 (7cf61ebde 2024-03-27)
相关推荐
良许Linux2 分钟前
0.96寸OLED显示屏详解
linux·服务器·后端·互联网
求知若饥15 分钟前
NestJS 项目实战-权限管理系统开发(六)
后端·node.js·nestjs
数据小爬虫@18 分钟前
如何高效利用Python爬虫按关键字搜索苏宁商品
开发语言·爬虫·python
ZJ_.20 分钟前
WPSJS:让 WPS 办公与 JavaScript 完美联动
开发语言·前端·javascript·vscode·ecmascript·wps
Narutolxy25 分钟前
深入探讨 Go 中的高级表单验证与翻译:Gin 与 Validator 的实践之道20241223
开发语言·golang·gin
Hello.Reader32 分钟前
全面解析 Golang Gin 框架
开发语言·golang·gin
禁默43 分钟前
深入浅出:AWT的基本组件及其应用
java·开发语言·界面编程
Code哈哈笑1 小时前
【Java 学习】深度剖析Java多态:从向上转型到向下转型,解锁动态绑定的奥秘,让代码更优雅灵活
java·开发语言·学习
gb42152871 小时前
springboot中Jackson库和jsonpath库的区别和联系。
java·spring boot·后端
程序猿进阶1 小时前
深入解析 Spring WebFlux:原理与应用
java·开发语言·后端·spring·面试·架构·springboot