Vscode-rust: RLS fails to start, error running rustup

Created on 4 Apr 2018  路  8Comments  路  Source: rust-lang/vscode-rust

I'm getting a warning:

RLS could not set RUST_SRC_PATH for Racer because it could not read the Rust sysroot.

later on:

Unexpected error initialising RLS - error running rustup

in the Rust Language Server logs:

[Error - 1:38:05 PM] Starting client failed
Error: Error starting up rls.
    at /home/marcin/.vscode/extensions/rust-lang.rust-0.4.1/out/src/extension.js:127:19
    at Generator.throw (<anonymous>)
    at rejected (/home/marcin/.vscode/extensions/rust-lang.rust-0.4.1/out/src/extension.js:14:65)
    at <anonymous>

Most helpful comment

The same thing that happened to @robatipoor also happened to me. Thanks for the guidance on how to fix it.

For those (like me), who need a little more hand-holding on vscode, here is what I did to fix it, step-by-step:
1) Open vscode,
2) Menu: File -> Preferences -> Settings
3) Under "User Settings", click "Extensions", click "Rust configuration"
4) Near the top, under "Rust client: Channel" click "edit in settings.json"
5) Add the following line: "rust-client.channel": "stable"

So the file looks something like this:
{
"window.zoomLevel": 0,
"rust-client.channel": "stable"
}

6) Now save. When you next open a workspace and edit a .rs file, RLS should work as expected. Note that RLS only works in a workspace.

All 8 comments

When trying to rustup component add rust-src, as advised by @Xanewok, rustup complained that there is no default toolchain.

After

rustup install nightly
rustup default nightly

and installing rls via rustup components (as described in the rls readme) the problem was gone.

Nevertheless, a more helpful error message would be nice.

Unfortunately, I have encountered a very similar error after cleaning ~/.rustup with rm -rf ~/.rustup.

As previously, I tried to install the nightly toolchain. Due to rust-lang/rust#51699 I needed to specify it manually:

rustup install nightly-2018-06-18
rustup default nightly-2018-06-18
rustup component add rls-preview rust-analysis rust-src

The error message is exactly the same.

/edit: after setting "rust-client.channel": "stable" I can install and use RLS, so this may be closely related to rust-lang/rust#51699. Anyway, a more helpful message would be nice.

@marmistrz could you try again today please? Nightly on rustup has been broken for a few days but should now be fixed.

I'm getting same error after update to stable-x86_64-unknown-linux-gnu - rustc 1.33.0 (2aa4c46cf 2019-02-28) and nightly-x86_64-unknown-linux-gnu - rustc 1.35.0-nightly (f22dca0a1 2019-03-05)

@robatipoor Looks like the #517.

Adding rust-client.channel worked for me as well.

The same thing that happened to @robatipoor also happened to me. Thanks for the guidance on how to fix it.

For those (like me), who need a little more hand-holding on vscode, here is what I did to fix it, step-by-step:
1) Open vscode,
2) Menu: File -> Preferences -> Settings
3) Under "User Settings", click "Extensions", click "Rust configuration"
4) Near the top, under "Rust client: Channel" click "edit in settings.json"
5) Add the following line: "rust-client.channel": "stable"

So the file looks something like this:
{
"window.zoomLevel": 0,
"rust-client.channel": "stable"
}

6) Now save. When you next open a workspace and edit a .rs file, RLS should work as expected. Note that RLS only works in a workspace.

The same thing that happened to @robatipoor also happened to me. Thanks for the guidance on how to fix it.

For those (like me), who need a little more hand-holding on vscode, here is what I did to fix it, step-by-step:

  1. Open vscode,
  2. Menu: File -> Preferences -> Settings
  3. Under "User Settings", click "Extensions", click "Rust configuration"
  4. Near the top, under "Rust client: Channel" click "edit in settings.json"
  5. Add the following line: "rust-client.channel": "stable"

So the file looks something like this:
{
"window.zoomLevel": 0,
"rust-client.channel": "stable"
}

  1. Now save. When you next open a workspace and edit a .rs file, RLS should work as expected. Note that RLS only works in a workspace.

Thank's, that was the solution for me !

We now surface a lot more errors as to why RLS could not be started or installed, so I'll close this issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Tape-Worm picture Tape-Worm  路  4Comments

views63 picture views63  路  5Comments

alexreg picture alexreg  路  3Comments

mcclure picture mcclure  路  4Comments

byteshiva picture byteshiva  路  4Comments