You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Both the VSCode TERMINAL and the first line of OUTPUT show the correct SHELL, which is /bin/zsh, but I don't know why it keeps trying /bin/sh in the rest.
2024-06-17 09:34:20.143 [info] (project) Running command: `ruby -W0 -rjson -e 'STDERR.print({ env: ENV.to_h, yjit: !!defined?(RubyVM::YJIT), version: RUBY_VERSION }.to_json)'` in project using shell: /bin/zsh2024-06-17 09:34:21.309 [info] (project) /bin/sh: ruby-lsp: command not found2024-06-17 09:34:21.310 [info] (project) [Error - 09:34:21] Server process exited with code 127.2024-06-17 09:34:21.310 [info] (project) [Error - 09:34:21] Server initialization failed.2024-06-17 09:34:21.310 [info] (project) Message: Pending response rejected since connection got disposed Code: -32097 2024-06-17 09:34:21.310 [info] (project) [Info - 09:34:21] Connection to server got closed. Server will restart.2024-06-17 09:34:21.310 [info] (project) true2024-06-17 09:34:21.310 [info] (project) [Error - 09:34:21] Ruby LSP client: couldn't create connection to server.2024-06-17 09:34:21.310 [info] (project) Message: Pending response rejected since connection got disposed Code: -32097 2024-06-17 09:34:21.311 [error] (project) Error starting the server: Pending response rejected since connection got disposed2024-06-17 09:34:21.318 [info] (project) /bin/sh: ruby-lsp: command not found2024-06-17 09:34:21.319 [info] (project) [Error - 09:34:21] Server process exited with code 127.2024-06-17 09:34:21.319 [info] (project) [Error - 09:34:21] Server initialization failed.2024-06-17 09:34:21.319 [info] (project) Message: Pending response rejected since connection got disposed Code: -32097 2024-06-17 09:34:21.319 [info] (project) [Info - 09:34:21] Connection to server got closed. Server will restart.2024-06-17 09:34:21.319 [info] (project) true2024-06-17 09:34:21.319 [info] (project) [Error - 09:34:21] Ruby LSP client: couldn't create connection to server.2024-06-17 09:34:21.319 [info] (project) Message: Pending response rejected since connection got disposed Code: -32097 2024-06-17 09:34:21.326 [info] (project) /bin/sh: ruby-lsp: command not found2024-06-17 09:34:21.326 [info] (project) [Error - 09:34:21] Server process exited with code 127.2024-06-17 09:34:21.326 [info] (project) [Error - 09:34:21] Server initialization failed.2024-06-17 09:34:21.326 [info] (project) Message: Pending response rejected since connection got disposed Code: -32097 2024-06-17 09:34:21.326 [info] (project) [Info - 09:34:21] Connection to server got closed. Server will restart.2024-06-17 09:34:21.326 [info] (project) true2024-06-17 09:34:21.326 [info] (project) [Error - 09:34:21] Ruby LSP client: couldn't create connection to server.2024-06-17 09:34:21.326 [info] (project) Message: Pending response rejected since connection got disposed Code: -32097 2024-06-17 09:34:21.326 [info] (project) [Error - 09:34:21] Restarting server failed2024-06-17 09:34:21.326 [info] (project) Message: Pending response rejected since connection got disposed Code: -32097 2024-06-17 09:34:21.342 [info] (project) /bin/sh: ruby-lsp: command not found2024-06-17 09:34:21.342 [info] (project) [Error - 09:34:21] Server process exited with code 127.2024-06-17 09:34:21.343 [info] (project) [Error - 09:34:21] Server initialization failed.2024-06-17 09:34:21.343 [info] (project) Message: Pending response rejected since connection got disposed Code: -32097 2024-06-17 09:34:21.343 [info] (project) [Info - 09:34:21] Connection to server got closed. Server will restart.2024-06-17 09:34:21.343 [info] (project) true2024-06-17 09:34:21.343 [info] (project) [Error - 09:34:21] Ruby LSP client: couldn't create connection to server.2024-06-17 09:34:21.343 [info] (project) Message: Pending response rejected since connection got disposed Code: -32097 2024-06-17 09:34:21.343 [info] (project) [Error - 09:34:21] Restarting server failed2024-06-17 09:34:21.343 [info] (project) Message: Pending response rejected since connection got disposed Code: -32097 2024-06-17 09:34:21.348 [info] (project) /bin/sh: ruby-lsp: command not found2024-06-17 09:34:21.348 [info] (project) [Error - 09:34:21] Server process exited with code 127.2024-06-17 09:34:21.349 [info] (project) [Error - 09:34:21] Server initialization failed.2024-06-17 09:34:21.349 [info] (project) Message: Pending response rejected since connection got disposed Code: -32097 2024-06-17 09:34:21.349 [info] (project) [Error - 09:34:21] The Ruby LSP server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.2024-06-17 09:34:21.349 [info] (project) [Error - 09:34:21] Ruby LSP client: couldn't create connection to server.2024-06-17 09:34:21.349 [info] (project) Message: Pending response rejected since connection got disposed Code: -32097 2024-06-17 09:34:21.349 [info] (project) [Error - 09:34:21] Restarting server failed2024-06-17 09:34:21.349 [info] (project) Message: Pending response rejected since connection got disposed Code: -32097
The text was updated successfully, but these errors were encountered:
Thank you for the bug report. We'll need more details to be able to understand what is going on.
I see that you have the version manager configured to None. How do you install Ruby? And how do you select the right version? We need to be able to activate the Ruby runtime to launch the gem executable.
How do you install Ruby? And how do you select the right version?
brew install ruby and has been added to PATH in .zchrc.
I don't need to select a version, the global version works fine for me.
check your default VS Code shell in the integrated terminal (click the down arrow)
Interestingly, I don't have a (default) item here, but when I click the + sign it starts a zsh which is the default shell for my account. I assume this is the VSCode initial setup since I've never set it up or modified it.
We don't source shell scripts automatically, so if you're adding things manually to the PATH in a configuration file, that's the reason why we don't find it.
Sourcing shell scripts has caused a lot of headaches to users in the past and we moved completely away from it.
In this case, you will need to configure custom activation to let the Ruby LSP know how to find the Ruby version:
// Your VS Code settings{// Set the manager to custom"rubyLsp.rubyVersionManager": {"identifier": "custom",},// Define a shell script that runs immediately before trying to launch, doing// whatever needs to be done to find Ruby. In your case, add the right path// to the PATH"rubyLsp.customRubyCommand": "PATH=/path/to/ruby/bin:$PATH",}
VSCode Ruby LSP
https://marketplace.visualstudio.com/items?itemName=Shopify.ruby-lsp
https://github.com/Shopify/ruby-lsp/blob/main/vscode/README.md
https://github.com/Shopify/ruby-lsp/blob/main/TROUBLESHOOTING.md
Both the VSCode
TERMINAL
and the first line ofOUTPUT
show the correctSHELL
, which is/bin/zsh
, but I don't know why it keeps trying/bin/sh
in the rest.The text was updated successfully, but these errors were encountered: