Closed qupig closed 4 months ago
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.
The /bin/sh
is the default when using NodeJS' exec
function. But we do use whatever the VS Code API tells us the shell is.
If you check your default VS Code shell in the integrated terminal (click the down arrow), does it match what you expect (zsh)?
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.