I tried to update my rust and it failed:
rustup update
info: syncing channel updates for 'stable-x86_64-pc-windows-msvc'
info: latest update on 2018-08-02, rust version 1.28.0 (9634041f0 2018-07-30)
info: downloading component 'rustc'
info: downloading component 'rust-std'
info: downloading component 'cargo'
info: downloading component 'rust-docs'
info: downloading component 'rust-src'
info: removing component 'rustc'
info: rolling back changes
error: failure removing component 'rustc-x86_64-pc-windows-msvc', directory does not exist: '"bin/rustc.exe"'
info: checking for self-updatesstable-x86_64-pc-windows-msvc update failed - (rustc does not exist)
So I tried re-installing and it fails.
Welcome to Rust!
This will download and install the official compiler for the Rust programming
language, and its package manager, Cargo.It will add the cargo, rustc, rustup and other commands to Cargo's bin
directory, located at:_-omitted-_
This path will then be added to your PATH environment variable by modifying the
HKEY_CURRENT_USER/Environment/PATH registry key.You can uninstall at any time with rustup self uninstall and these changes will
be reverted.Current installation options:
default host triple: x86_64-pc-windows-msvc
default toolchain: stable
modify PATH variable: yes1) Proceed with installation (default)
2) Customize installation
3) Cancel installation1
error: toolchain 'stable' is not installed
info: caused by: not a directory: '_-omitted-_.rustuptoolchainsstable-x86_64-pc-windows-msvc'Press the Enter key to continue.
So I am now stuck, it was fine before I tried the rustup update. :(
FYI: the toolchain existed, so I deleted it, but that didn't help.
FYI: I have rebooted my PC and was able to re-install via rustup-init.
info: syncing channel updates for 'stable-x86_64-pc-windows-msvc'
info: latest update on 2018-08-02, rust version 1.28.0 (9634041f0 2018-07-30)
info: downloading component 'rustc'
51.1 MiB / 51.1 MiB (100 %) 7.3 MiB/s ETA: 0 s
info: downloading component 'rust-std'
46.0 MiB / 46.0 MiB (100 %) 6.2 MiB/s ETA: 0 s
info: downloading component 'cargo'
info: downloading component 'rust-docs'
9.4 MiB / 9.4 MiB (100 %) 5.6 MiB/s ETA: 0 s
info: installing component 'rustc'
info: installing component 'rust-std'
info: installing component 'cargo'
info: installing component 'rust-docs'
info: default toolchain set to 'stable'stable installed - rustc 1.28.0 (9634041f0 2018-07-30)
Rust is installed now. Great!
I guess the remaining issue is why did _rustup update_ lose its mind?
error: failure removing component 'rustc-x86_64-pc-windows-msvc', directory does not exist: '"bin/rustc.exe"'
The real question is why the heck does it think "bin/rustc.exe" is a directory???
Since this is a rustup issue, it should be reported at https://github.com/rust-lang/rustup.rs - closing in favor of an upstream issue there.
This being the top result in Google for this problem, I'd like to mention that I had the same issue, but restarting my machine did not work. I then ran:
rustup self uninstall
I then redownloaded rustup-init.exe from rust-lang.org and ran it.
This fixed the problem for me.
Most helpful comment
This being the top result in Google for this problem, I'd like to mention that I had the same issue, but restarting my machine did not work. I then ran:
rustup self uninstall
I then redownloaded rustup-init.exe from rust-lang.org and ran it.
This fixed the problem for me.