What's the proper way to install RLS to work with Visual Studio Code on Ubuntu?

Hi folks...

Have a question about proper install procedure on of the Rust extension for Visual Studio Code on Ubuntu.

I get this prompt in Visual Studio Code asking if RLS should be installed and if I select "yes", the installation starts but ends up failing due to lack of rights (reason being that the installation would require sudo and VSC is not typically started under sudo).

On another hand installing RLS outside of VSC using a command such as "sudo rustup component add rls rust-analysis rust-src" leads to it being installed but the installation is not recognized by VSC. So next time user starts Visual Studio Code, it prompts for the RLS installation again.

Is there some configuration step(s) that needs to be completed to get the plugin to work with RLS?

Thanks,

How did you install rustup? Was it a package?

Normally when you install rustup from rustup.rs, it defaults to installing in your home directory, so that sudo rustup is not required.

(note: I'm on Arch and I got rustup through a package manager, but it only installed rustup and the compiler wrappers to a system path (/usr/bin/{rustup,cargo,rustc,...}); toolchains still get installed to the default location in ~/.rustup for me)

1 Like

hi ExpHP,

I installed rustup using this command:

sudo curl https://sh.rustup.rs -sSf | sh

I tried first without "sudo" but it failed with permission errors (I am on Ubuntu 16.04 LTS, maybe its related to that).

Can you share the errors?

(also, I suspect the sudo was before the sh and not the curl; but that's besides the point)

A no harm in seeing step is to check file ownership.
find ~ ! -user $(id -un)
Should not print anything if ownership is correct.

thanks @ExpHP and @jonh I went to do a re-install to get screen shots to show the error messages and for some reason it now worked OK.

I don't know what may have changed but this can be considered closed.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.