Couldn't start client Rust Language Server

让人想犯罪 __ 提交于 2020-06-14 06:43:59

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!