通过 rustup 安装 Rust 后没有默认的 toolchain
大家好!我刚学 Rust,安装后马上遇到了问题。我下载并运行了 Windows 上的 `rustup-init.exe`,一切顺利。但当我打开终端输入 `rustc --version` 或 `cargo --version` 时,却报错:
```
error: no default toolchain configured
error: Rust is not installed yet. Install it by running 'rustup install stable'.
```
我按系统提示执行了 `rustup install stable`,但系统提示 stable 已安装。而 `rustup show` 显示:
```
Default host: x86_64-pc-windows-msvc
rustup home: C:\Users\me\.rustup
installed toolchains
--------------------
stable-x86_64-pc-windows-msvc (default)
active toolchain
----------------
(none)
```
看到了吗?stable 后面写着 "(default)",但 active toolchain 却是 "(none)"。这很奇怪。我试过重启终端、重启电脑,甚至删除 `.rustup` 文件夹后重装 rustup,都没用。