Vscode-rust: VSCode fails to start RLS: '--toolchain <toolchain>' requires a value but none was supplied

Created on 24 Oct 2019  ·  3Comments  ·  Source: rust-lang/vscode-rust

I am learning rust, and only beginning. My setup:

OS: up-to-date 64-bit Archlinux with rustup 1.20.2 and code 1.39.2 installed from the software repositories.
Commands run so far:

$ rustup default stable
$ rustup component add rls rust-analysis rust-src

In VS Code :

Command failed: rustup component list --toolchain error: The argument '--toolchain <toolchain>' requires a value but none was supplied USAGE: rustup component list --toolchain <toolchain> For more information try --help

Most helpful comment

It seems, that VS Code is not able to deal with custom paths.
In my environment, I have:

CARGO_HOME="$HOME/.local/opt/rust_cargo"
RUSTUP_HOME="$HOME/.local/opt/rustup"
PATH="$HOME/.local/bin:$CARGO_HOME/bin:…"

And VS Code is obviously ignoring both …_HOME variables. I _can_ set CARGO_HOME in the settings, but even then, it is ignored. RUSTUP_HOME cannot even be set. Anyway, VS Code keeps creating ~/.cargo and ~/.rustup… I tried symlinking these to my custom places so that VS Code finds them, but even so, it says that RLS is not found.

By the way, for a _new_ language, I cannot understand how the RUST team chose to place cache, lib, and settings files together, and right inside ~! The XDG specifications are so good at keeping the clutter at bay; too bad they were not followed.

All 3 comments

It seems, that VS Code is not able to deal with custom paths.
In my environment, I have:

CARGO_HOME="$HOME/.local/opt/rust_cargo"
RUSTUP_HOME="$HOME/.local/opt/rustup"
PATH="$HOME/.local/bin:$CARGO_HOME/bin:…"

And VS Code is obviously ignoring both …_HOME variables. I _can_ set CARGO_HOME in the settings, but even then, it is ignored. RUSTUP_HOME cannot even be set. Anyway, VS Code keeps creating ~/.cargo and ~/.rustup… I tried symlinking these to my custom places so that VS Code finds them, but even so, it says that RLS is not found.

By the way, for a _new_ language, I cannot understand how the RUST team chose to place cache, lib, and settings files together, and right inside ~! The XDG specifications are so good at keeping the clutter at bay; too bad they were not followed.

I've had the same problem, but after some fiddling around, ignoring the issue and proceeding in configuring my Webpack setup, the plugin involved in Webpack handling of Rust-related code (wasm-pack-plugin) started complaining about the lack of a default toolchain.

TL;DR It seems that Arch installation of rustup does not set the default toolchain. After executing the following commands to download and set it up:

rustup install stable
rustup default stable

all problems went away and VSCode is not complaining anymore.

@TeHMoroS thanks for that. i was running into the error from OP on arch linux, running those 2 commands fixed it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

harrier-lcc picture harrier-lcc  ·  4Comments

fzzr- picture fzzr-  ·  4Comments

not-fl3 picture not-fl3  ·  3Comments

iBeizsley picture iBeizsley  ·  3Comments

simobiggs picture simobiggs  ·  4Comments