-
Notifications
You must be signed in to change notification settings - Fork 174
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
Existing projects do not create the .ruby-lsp folder #1783
Comments
Thank you for the bug report! Can you share the exact error you're seeing? Is there anything printed to the The |
I believe I have the same bug using a different setup. Windows 11 10.0.22621 Following is shown in the notification area in VS Code a few seconds after starting it:
Running the command |
Also posted here. Not sure which place is best. |
@davideluque is this problem still happening? If so, can you share the contents of the Output tab? |
This issue seems to be preventing me and many others from using Ruby-LSP "out of the box". I first encountered the issue of Ruby-LSP plain not working (stuck on Ruby LSP: Starting, no output at all, silence on all frequencies) on WSL2 Ubuntu - I figured that perhaps since the extension is so fresh there's some WSL2 jank stopping it from working. Back to my Xubuntu 22 VM I went and to my surprise - the exact same issue. By now, I've encountered three other users that have the same exact issue - they migrate from now deprecated extensions and they're left with nothing, without any clue to what's happening. Thankfully, I think I believe I have identified the culprit. The SetupA fresh VirtualBox 7 Xubuntu 22.04 install:
The TroubleFirst, I checked whether an old project of mine will work "out of the box", so I cloned my Connect Four repo and opened it with
Second, I figured let's just do a fresh run. I created a new directory, opened VSCode with # testing
two = 1 + 1
p two
sdasdasd # this error is here on purpose and is because of me testing a different issue w/ the debugger Nothing. The BreakthroughI believe I picked this approach by reading through various issues in this repo - manually creating stuff that should be in
The SolutionNow, I played around for a while and it all hinges on the presence of a file called This is a departure from how previous extensions have worked - they worked out of the box on any Ruby file - Gemfile.lock or no Gemfile.lock. There's some other "quirks" compared to the previous setup but I'm not sure if all of them are a Ruby-LSP problem or something else - I'll soon file an issue report for at least one thing I believe is on Ruby-LSP's end. EDIT: Apologies, I didn't notice Shopify/vscode-ruby-lsp#945 . I assume that'll fix this. |
@scheals just a little advice based what you said above: It's almost always worth adding a You can learn more here: https://bundler.io/guides/getting_started.html |
(Apologies for the off-topic but I feel like it'd be in bad taste not to respond to someone offering good advice) @andyw8
From my observation, there's plenty of people that do not use bundles and come from the old extensions wondering why the new one is not working at all. If I saw someone having issues with the extension, the very first instinct of mine would be: "Let's cut off all the variables. New directory, new file, some "Hello world!" tier code, no gems, nothing fancy. Bare Ruby file." Due to Ruby-LSP not working correctly (and reporting absolutely nil) on opening a Ruby file for one reason or another, that'd be somewhat of a puzzling dead-end. I'm very grateful for your and other maintainer's work. Ruby-LSP is an upgrade from the previous extensions and I'm excited to see it grow, so chapeau bas for taking on such an important project for Rubyists. |
This issue is being marked as stale because there was no activity in the last 2 months |
It's unclear to me if what @scheals has reported is exactly the same scenario as the original author's. However, it is an issue indeed. We're currently not allowing the Ruby LSP to be used without any folders opened in VS Code (by early returning here). The fix is not super trivial though. We will need to add some CLI flag to the server to allow it being launched bypassing the custom bundle logic and then pass that flag when there are no folders opened in VS Code. |
The issue mentioned by @scheals is the same as #1780. Let's please centralize discussions related to usage without workspaces there. Regarding this original issue, it's unclear as to what exactly the problem was. We made several improvements to version manager integrations, so hopefully the problem has been solved. If not, please let us know. |
Operating System
MacOS Sonoma
Ruby version
3.1.4
Project has a bundle
Ruby version manager being used
asdf
Description
The extension is installed in VSCode, but when I open other projects, the server fails to start because the .ruby-lsp folder isn't created automatically, and there isn't a command to do so.
The text was updated successfully, but these errors were encountered: