问题
I'm trying to figure out how to use rustc & cargo from my WSL. I use VS Code and Rust (rls) plugin and can compile my code but there is a problem with RLS:
Couldn't start client Rust Language Server
Rustup not available. Install from https://www.rustup.rs/
How i can solve this problem?
回答1:
I had this problem as well with WSL and Visual Studio Code. The problem seems to stem from the fact that the Rust Language Server needs to find rustup
in your path. We both probably followed the same path of using a package manager to install cargo
, and therefore, the rust compiler tools. This does not include rustup
which you can actually use to keep the rust toolchain up-to-date. rustup
also appears to be the preferred method of installing the rust toolchain on your system.
After installing rustup
with the default setup, you should see a .rustup
directory in your home directory. This is where the toolchain lives. The install text all stated that it would add the toolchain to your environment path after logging out and back in, but I didn't have luck with this. I'm currently using fish
instead of bash
and had to update the configuration to include the toolchain at startup. Once I did that, I was able to have VSCode properly install and run the RLS.
来源:https://stackoverflow.com/questions/58312319/couldnt-start-client-rust-language-server