Skip to content
This repository has been archived by the owner on Nov 18, 2022. It is now read-only.

couldn't start client Rust Language Server #622

Open
billtlee opened this issue Jul 7, 2019 · 20 comments
Open

couldn't start client Rust Language Server #622

billtlee opened this issue Jul 7, 2019 · 20 comments

Comments

@billtlee
Copy link

billtlee commented Jul 7, 2019

Hi,

I just installed the 0.61 plugin and am running into the "couldn't start client rust language server" error. I have put the "rust-client.channel": "stable" into my settings.json and can run rustup from terminal spawned inside vsc. Please see the attached screenshot. Any idea on how to resolve this?
Screen Shot 2019-07-07 at 11 19 28 AM

@billtlee
Copy link
Author

billtlee commented Jul 7, 2019

Nevermind, I quit code and restarted it and it's now working.

@geropl
Copy link

geropl commented Jul 26, 2019

I had the same error with rust-client.channel being undefined. It's especially bad with first time (Rust/vscode) users. It would really help to have a default stable.

@leiz-me
Copy link

leiz-me commented Oct 24, 2019

I had the same issue. And vscode kept telling me "rls building".

After I set up the "rust-client.channel" and "rust-client.rustupPath" manually, both problems are solved.
Perhaps this would be helpful.

@parrotdance
Copy link

Add this line to setting.json might solve this problem:
"rust-client.rustupPath": "$HOME/.cargo/bin/rustup"
If you change the path during installation, just replace it with your own path.
btw, the default value is rustup, this is obviously not available.

I am using macOS catalina, but I think it should work at most of UNIX-like OS.

@jerrygreen
Copy link

I had this error, and @parrotdance thanks for your solution, it works! A little bit weird it's not working out of the box, though...

@samuela
Copy link

samuela commented Jan 24, 2020

@parrotdance Thanks! For others on the struggle bus, I found that you have to restart/reload VSCode for the setting to kick in.

@parrotdance
Copy link

@jerrygreen
Search rustup path in setting and it will show you a elegant way.
The real weird stuff is, the default value works well in Windows, anyone gonna resolve this?

@carycodes
Copy link

carycodes commented Mar 31, 2020

If this is a problem with macOS then it's probably down to the weird way that macOS handles $PATH. Specifically, the value that gets loaded for an app launched from dock or spotlight is not the same as the value that gets loaded for a terminal session. Under normal (default) install conditions, VSCode on macOS will not be able to find rustup.

@chris73it
Copy link

I am on Windows 10 (May 2020 release 2004) and I am experiencing the same issue.

@toknsi
Copy link

toknsi commented Aug 2, 2020

I am on Windows 10 (May 2020 release 2004) and I am experiencing the same issue.

  • install rls
  • config rustupPath

if wsl choose config of remote wsl
image

@eutobias
Copy link

eutobias commented Sep 2, 2020

Everything works fine for me after add this:

{ "rust-client.channel": "stable", "rust-client.rustupPath": "$HOME/.cargo/bin/rustup" }

to my config, i´m using Ubuntu 20 with WSL2 on windows 10

@prosenboim
Copy link

Same on Fedora 31. I installed rust from package manager, so I have no rustup in the system.

@woss
Copy link

woss commented Dec 2, 2020

i've solved it setting this in the local settings.json file "rust-client.disableRustup": true

@danawoodman
Copy link

"rust-client.channel": "stable" seemed to be the magic sauce for me, thanks @eutobias 🎉

Too bad this isn't working out of the box 😢

@Emmanuerl
Copy link

Nevermind, I quit code and restarted it and it's now working.

Thanks. This worked for me.

@0x1af2aec8f957
Copy link

If you use brew installation, configure it in settings.json as follows:

{
    // Rust configure
    "rust-client.channel": "stable", // Channel
    "rust-client.rlsPath": "/opt/homebrew/opt/rust-analyzer/bin/rust-analyzer", // Language server
    "rust-client.disableRustup": true,
    // "rust-client.rustupPath": "$HOME/.cargo/bin/rustup",
}

@flodiebold
Copy link
Member

@0x1af2aec8f957 to use rust-analyzer, please use the rust-analyzer extension right now. The VSCode-Rust extension doesn't work very well with RA at the moment.

@coffeedome
Copy link

I guess in addition to the answers above you can also just run the below as sudo (assuming here you're on a Mac):

$HOME/.cargo/bin/rustup component add rust-analysis --toolchain stable 
$HOME/.cargo/bin/rustup component add rust-src --toolchain stable 
$HOME/.cargo/bin/rustup component add rls --toolchain stable 

@lnicola
Copy link
Member

lnicola commented Jul 11, 2021

You probably shouldn't run rustup with sudo, since it sets up per-user toolchains, so you'll get one installed for root.

@tan-wei
Copy link

tan-wei commented Feb 24, 2022

I met this issue with Windows today. Before yesterday, it worked quite well.

After I manual add path of rust in ENV, it is solved.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests