163

I installed Rust using rustup, but when I try to enter a Rust command like cargo or rustc in my console, the following error appears:

error: no default toolchain configured

Is this a known issue?

kmdreko
  • 42,554
  • 6
  • 57
  • 106
Darkaird
  • 2,700
  • 4
  • 15
  • 29
  • What do you get when running `rustup toolchain list`? – E_net4 Jun 01 '17 at 10:00
  • 2
    @E_net4 I get : "no installed toolchains" – Darkaird Jun 01 '17 at 10:02
  • 1
    Well, you've answered your own question. Install a toolchain (preferably default). The strange part of this is that it wasn't installed by default. – E_net4 Jun 01 '17 at 10:14
  • 2
    Yeah, as you mentionne, rustup-init.exe isn't suppose to install a default toolchain ? I can't even uninstall with "rustup self uninstall" command, the same error appear... – Darkaird Jun 01 '17 at 10:21
  • Can you update your question with everything that you have tried so far? – E_net4 Jun 01 '17 at 10:23
  • I have @Darkaird's experience, and I agree "The strange part of this is that it wasn't installed by default" -- my installation configuration (before running) says: `default toolchain: stable (default)` and after running, the message says: `info: default toolchain set to 'stable-x86_64-pc-windows-msvc' stable-x86_64-pc-windows-msvc installed - rustc 1.66.0 (69f9c33d7 2022-12-12)` weird... – Nate Anderson Jan 08 '23 at 01:11
  • In my case I was using Windows installer; when changed the value of `RUSTUP_HOME` and `CARGO_HOME` to the `C:\` directory directly: `set "RUSTUP_HOME=C:\.rustup" & set "CARGO_HOME=C:\.cargo"` , I got this error. When I uninstalled and let the default values: `%USERPROFILE%\.cargo` and `%USERPROFILE%\.rustup`, I didn't get this error anymore. That's OK, I guess plenty of other directories are installed at `%USERPROFILE%`, like `.matplotlib`, `.gem`, `.ipynb` , `.ssh` – Nate Anderson Jan 08 '23 at 01:17

4 Answers4

334

If it seems that rustup did not successfully install and configure the stable toolchain, you can do it manually:

rustup install stable
rustup default stable

After testing, it seems like my incomplete installation may have been caused by a network error. You can also try to reinstall to solve the problem.

Shepmaster
  • 388,571
  • 95
  • 1,107
  • 1,366
BlackGlory
  • 3,866
  • 2
  • 15
  • 21
8

The problem is due to my connection and my proxy which didn't allow rustc, cargo, and others to be downloaded.

I thought that the all the executables were all-in-one but apparently not.

Shepmaster
  • 388,571
  • 95
  • 1,107
  • 1,366
Darkaird
  • 2,700
  • 4
  • 15
  • 29
4

In my case, I had multirust installed and the following worked for me:

multirust install stable
multirust default stable
anothernode
  • 5,100
  • 13
  • 43
  • 62
FroiD
  • 49
  • 7
4

I installed rust with root, but my IDE doesn't run as root, so I installed rust without root, all worked well.

Kaki
  • 9
  • 3
wangsir
  • 374
  • 2
  • 7