Closed argent-smith closed 3 months ago
Hi @argent-smith, can you try running ruby-lsp-doctor
in your repo, and see if it hangs.
And also check for any errors in the Ruby LSP output panel.
can you try running
ruby-lsp-doctor
in your repo, and see if it hangs
Hi @andyw8, ruby-lsp-doctor doesn't hang
And also check for any errors in the Ruby LSP output panel.
It looks like this:
@andyw8 also, this works fine:
⟩ bundle exec ruby-lsp --time-index
Ruby LSP v0.17.6: Indexing took 9.86661 seconds and generated:
- Module: 14269
- Class: 9314
- Method: 72038
- InstanceVariable: 23228
- Accessor: 9433
- UnresolvedMethodAlias: 3000
- Constant: 7616
- SingletonClass: 3208
- UnresolvedAlias: 434
Thanks, please also check here for errors (choose Output, then select Ruby LSP):
@andyw8 thank you for the point. I've found and fixed the problem! Thanks to all the contributors for a great tool!
Fixed
Note: The ruby-lsp-doctor
command is now ruby-lsp --doctor
(https://github.com/Shopify/ruby-lsp/pull/2310)
I was having the same
Ruby 3.3.4
ruby-lsp 0.17.15
I run ruby-lsp --doctor
and get no errors, and my editor nvim
just hangs saying that it's at 0%.
Our issue: we needed to upgrade standard
.
Note: I attempted to upload screenshots, but for some reason it's not working at the moment.
A senior dev helped me fix it, here's what he did:
First we went to the output tab on vscode, and then selected Ruby LSP in the accordion top right.
We saw that a gem couldn't be installed.
Then we went to Preferences: Open Settings (UI), clicked the extensions tab, then Ruby LSP tab, then we saw that the Bundle Gemfile field waws filled with a path. This should've been empty, but our company configured it to a path, so normal ruby or rails projects couldn't use Ruby LSP.
It should be empty
I'm getting a similar issue. Ruby LSP fail to start because it can load a gem required by a rubocop config in a parent folder which shouldn't even be in use since to project has its own. Either way, the gem is installed for the ruby version in use.
They are not installed in the current bundle though.
2024-10-23 11:03:21.224 [info] (rubocop-eightyfourcodes) Finished initializing Ruby LSP!
2024-10-23 11:03:21.473 [info] (rubocop-eightyfourcodes) Error processing initialized: /home/anders/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/rubocop-1.67.0/lib/rubocop/feature_loader.rb:46:in `rescue in rescue in load': cannot load such file -- rubocop-gitlab-security (LoadError)
...
from /home/anders/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/ruby-lsp-0.20.1/lib/ruby_lsp/requests/support/rubocop_runner.rb:86:in `initialize'
Moved my default config to ~/.config/rubocop/config.yml
solved it
They are not installed in the current bundle though.
Bundler doesn't allow you to require any gems that aren't a part of the bundle. It explicitly sets up the $LOAD_PATH
to prevent that from happening, so we need all RuboCop extensions to be included in it.
It doesn't matter if they are in a separate Gemfile that you evaluate from the main Gemfile or any other structure, but they need to be a part of the bundle.
Description
Hi. On my project, I see "Ruby LSP: indexing files: 0% completed" notification and progress spinner — they stay forever
Configuration: VScode 1.91.0 Ruby LSP plugin v0.7.11 ruby-lsp in the project's bundle 0.17.6