-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LSP fails to start: Could not find command "_2.5.22_". #2731
Comments
It seems like the issue is with the binstubs generated by Rails not being compatible with the underscore for setting bundler version, assuming that you are running a Rails project. |
You can also set the Bundle Gemfile option to make the problem go away, because then it won't use the Rails bundler binstub:
|
Thank you for the report! On new Rails applications, it seems to work fine since the bundle binstub does account for the version being passed as an argument. Does updating the binstub to the latest fix the issue for you? |
Thanks for the responses! I had forgotten I even had binstubs to be honest. I did check the bundler man pages for the version syntax notation before I filed the issue though 😅 So, the issues still occurs when I use an updated bundler generated bin stub ( I also ran Lastly, I generated a new rails application and copied the bundle binstub over the top of my current one and still received the error.
Seems to be the same for me.
This seems to work. I've included my |
I've also started getting this on an existing project. The binstubs haven't been updated since April, and the
This also seems to work around it in meantime. |
I've also started running into this issue on Rails (8.0.0.beta1) projects.
I have solved this by removing the |
@atruskie thank you for sharing your binstub, that was helpful. I have the exact same binstub and I managed to get some better insights. If I run exactly what the Ruby LSP runs, I don't get the error: BUNDLE_GEMFILE=.ruby-lsp/Gemfile bundle _2.5.15_ exec ruby-lsp but if I manually invoke the binstub, I do get the same error BUNDLE_GEMFILE=.ruby-lsp/Gemfile bin/bundle _2.5.15_ exec ruby-lsp The thing we need to understand now is, why is invoking bundle exec using the binstub automatically? Is there some sort of Bundler setting that makes it prefer binstubs? |
@atruskie do you happen to have |
I think that is the issue indeed @andyw8. I also use mise-en-place with an alias that makes the |
So the alias overrides the If that's the case, I'm not sure what we can do from our side. We want to invoke bundle exec using the version that has been locked in your project to avoid Bundler version mismatch restarts, which lead to a failure to boot. I wonder if the bundle binstub not accepting a version is intentional and if we could change that instead. |
Yup, that's it, the ./bin folder is on my PATH. All the binstubs my project needs are in bin, including bundler and rails. I'll confess, I'm not an expert. I don't know whether all that is best practice or not, but it's worked for a long time, and it made sense (though I'm now suspecting one isn't manually supposed to invoke binstubs now?). I also don't have any ruby/gems versioning needs because I'm running in a container. Oh also: I get my docker build to install exactly the version of bundler that was used to bundle the bundle. So I myself never have mismatched bundler versions |
Thank you so much for mentioning the problem with |
We ended up deleting |
Is it the case for everyone on this thread that If you can all confirm if this is the scenario, then we can push a fix. |
That was the case with me @vinistock. |
Yes, this is the case effectively but not literally. For us, in a VSCode devcontainer:
So in our case the project directory's |
The |
This was introduced recently by the following change in #2658 (which resolved #2532):
ruby-lsp/lib/ruby_lsp/setup_bundler.rb
Lines 194 to 203 in 72f019a
Now when trying to activate the LSP in Visual Studio Code I see the following error message:
Log excerpts:
Log output
I tried:
To avoid running the custom bundle workflow but nothing worked.
I don't understand how inserting
_<version>_
betweenbundler
and the command is meant to form a valid bundler command?Ruby LSP Information
VS Code Version
1.94.2
Ruby LSP Extension Version
0.8.5
Ruby LSP Server Version
Unknown
Ruby LSP Addons
Ruby Version
3.2.2
Ruby Version Manager
none
Installed Extensions
Click to expand
Ruby LSP Settings
Click to expand
Workspace
User
The text was updated successfully, but these errors were encountered: