🙆
[Rust, Windows11] Can't run Rust on VSCode
When I run "src\main.rs" on VSCode, I got the Error like below.
Path to shell executable "PATH_TO_PROJECT\cargo" does not exist.
Environment: Windows11, VSCode 1.85.1
details
Here is my step.
- create new project
> cargo new projectName
- open the project on VSCode
- open "src\main.rs" on VSCode
- run "src\main.rs"
- The error appeared
Solution
- I added this setting on VSCode.
"rust-analyzer.runnableEnv": {"PATH": "C:\\Users\\USER_NAME\\.cargo\\bin"}
- And I restarted VSCode.
- Then I could run "src\main.rs".
reference:
P.S.
Then I thought about getting the Full error messages to write this post, so I commented out the setting on VSCode.
But the Error didn't happen again.
I'm not sure Why...
Discussion