No default toolchain configured after installing rustup
Asked Answered
N

4

165

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?

Notecase answered 1/6, 2017 at 9:38 Comment(7)
What do you get when running rustup toolchain list?Breughel
@Breughel I get : "no installed toolchains"Notecase
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.Breughel
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...Notecase
Can you update your question with everything that you have tried so far?Breughel
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...Vegetable
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 , .sshVegetable
G
339

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.

Girder answered 21/10, 2017 at 14:29 Comment(4)
I had a network error while installing rust -- my wi-fi connection dropped -- and had this same error message. Running these commands fixed it.Biochemistry
I installed rustup using yay, and it didn't run these commands it seems!Typhoeus
If you installed using yay please try the git version, mine worked. @ShubhamSharmaKirkuk
For me rustup default stable did the install as well, no need to run two commandsEpimenides
N
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.

Notecase answered 1/6, 2017 at 12:13 Comment(3)
I am 99.9999999999999999999999999999999999999999999% certain that no proxies are even involved in my setup, and I still get the same errors.Nikethamide
I didn't say that this is THE solution for the problem but it may be one.Notecase
I use cntlm to get past my company's proxy.Gregarious
S
4

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

multirust install stable
multirust default stable
Shannanshannen answered 7/8, 2018 at 12:3 Comment(0)
C
4

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

Chiarra answered 27/12, 2019 at 3:31 Comment(1)
Thank you , so sorry for my poor english. @KakiChiarra

© 2022 - 2024 — McMap. All rights reserved.