Shopify / ruby-lsp-rails

A Ruby LSP add-on for Rails
https://shopify.github.io/ruby-lsp/rails-add-on
MIT License
574 stars 28 forks source link

Ruby LSP Rails failed to initialize server #514

Open AlexVPopov opened 2 hours ago

AlexVPopov commented 2 hours ago

Hello,

Since today, I can't start the Ruby LSP server. Here's the output from the logs:

2024-11-06 17:20:09.075 [info] (platform) The Gemfile's dependencies are satisfied

2024-11-06 17:20:10.791 [info] (platform) Initializing Ruby LSP v0.21.3...
2024-11-06 17:20:10.796 [info] (platform) Auto detected formatter: rubocop
2024-11-06 17:20:10.796 [info] (platform) Auto detected linters: rubocop
2024-11-06 17:20:10.796 [info] (platform) Detected test library: rspec
2024-11-06 17:20:10.796 [info] (platform) Finished initializing Ruby LSP!
2024-11-06 17:20:10.955 [info] (platform) Activating Ruby LSP Rails add-on v0.3.23
2024-11-06 17:20:10.956 [info] (platform) Ruby LSP Rails booting server
2024-11-06 17:20:15.521 [info] (platform) [Error - 5:20:15 PM] Ruby LSP Rails failed to initialize server: /home/alexander/.rbenv/versions/3.2.4/lib/ruby/gems/3.2.0/gems/ruby-lsp-rails-0.3.23/lib/ruby_lsp/ruby_lsp_rails/runner_client.rb:295:in `block in read_response': RubyLsp::Rails::RunnerClient::EmptyMessageError (RubyLsp::Rails::RunnerClient::EmptyMessageError)
    from /home/alexander/.rbenv/versions/3.2.4/lib/ruby/gems/3.2.0/gems/ruby-lsp-rails-0.3.23/lib/ruby_lsp/ruby_lsp_rails/runner_client.rb:292:in `synchronize'
    from /home/alexander/.rbenv/versions/3.2.4/lib/ruby/gems/3.2.0/gems/ruby-lsp-rails-0.3.23/lib/ruby_lsp/ruby_lsp_rails/runner_client.rb:292:in `read_response'
    from /home/alexander/.rbenv/versions/3.2.4/lib/ruby/gems/3.2.0/gems/sorbet-runtime-0.5.11637/lib/types/private/methods/_methods.rb:279:in `bind_call'
    from /home/alexander/.rbenv/versions/3.2.4/lib/ruby/gems/3.2.0/gems/sorbet-runtime-0.5.11637/lib/types/private/methods/_methods.rb:279:in `block in _on_method_added'
    from /home/alexander/.rbenv/versions/3.2.4/lib/ruby/gems/3.2.0/gems/ruby-lsp-rails-0.3.23/lib/ruby_lsp/ruby_lsp_rails/runner_client.rb:90:in `initialize'
    from /home/alexander/.rbenv/versions/3.2.4/lib/ruby/gems/3.2.0/gems/sorbet-runtime-0.5.11637/lib/types/private/methods/_methods.rb:279:in `bind_call'
    from /home/alexander/.rbenv/versions/3.2.4/lib/ruby/gems/3.2.0/gems/sorbet-runtime-0.5.11637/lib/types/private/methods/_methods.rb:279:in `block in _on_method_added'
    from /home/alexander/.rbenv/versions/3.2.4/lib/ruby/gems/3.2.0/gems/ruby-lsp-rails-0.3.23/lib/ruby_lsp/ruby_lsp_rails/runner_client.rb:16:in `new'
    from /home/alexander/.rbenv/versions/3.2.4/lib/ruby/gems/3.2.0/gems/ruby-lsp-rails-0.3.23/lib/ruby_lsp/ruby_lsp_rails/runner_client.rb:16:in `create_client'
    from /home/alexander/.rbenv/versions/3.2.4/lib/ruby/gems/3.2.0/gems/sorbet-runtime-0.5.11637/lib/types/private/methods/_methods.rb:279:in `bind_call'
    from /home/alexander/.rbenv/versions/3.2.4/lib/ruby/gems/3.2.0/gems/sorbet-runtime-0.5.11637/lib/types/private/methods/_methods.rb:279:in `block in _on_method_added'
    from /home/alexander/.rbenv/versions/3.2.4/lib/ruby/gems/3.2.0/gems/ruby-lsp-rails-0.3.23/lib/ruby_lsp/ruby_lsp_rails/addon.rb:41:in `block (3 levels) in initialize'
    from /home/alexander/.rbenv/versions/3.2.4/lib/ruby/gems/3.2.0/gems/ruby-lsp-rails-0.3.23/lib/ruby_lsp/ruby_lsp_rails/addon.rb:41:in `synchronize'
    from /home/alexander/.rbenv/versions/3.2.4/lib/ruby/gems/3.2.0/gems/ruby-lsp-rails-0.3.23/lib/ruby_lsp/ruby_lsp_rails/addon.rb:41:in `block (2 levels) in initialize'
    from /home/alexander/.rbenv/versions/3.2.4/lib/ruby/gems/3.2.0/gems/ruby-lsp-rails-0.3.23/lib/ruby_lsp/ruby_lsp_rails/addon.rb:39:in `synchronize'
    from /home/alexander/.rbenv/versions/3.2.4/lib/ruby/gems/3.2.0/gems/ruby-lsp-rails-0.3.23/lib/ruby_lsp/ruby_lsp_rails/addon.rb:39:in `block in initialize'

Server dependent features will not be available

Below is the Ruby LSP debug information. Could you point me to how I can troubleshoot this problem? Thank you. :)

Ruby LSP Information

VS Code Version

1.95.1

Ruby LSP Extension Version

0.8.13

Ruby LSP Server Version

0.21.3

Ruby LSP Addons

Ruby Version

3.2.4

Ruby Version Manager

rbenv

Installed Extensions

Click to expand - copilot (1.243.0) - copilot-chat (0.22.1) - elixir-ls (0.24.2) - gitlens (15.6.3) - go (0.42.1) - makefile-tools (0.11.13) - prettier-sql-vscode (1.6.0) - rainbow-csv (3.12.0) - ruby-extensions-pack (0.1.12) - ruby-lsp (0.8.13) - sorbet-vscode-extension (0.3.37) - terraform (2.33.0) - vscode-fileutils (3.10.3) - vscode-graphql (0.12.1) - vscode-json-validate (1.5.0) - vscode-yaml (1.15.0)

Ruby LSP Settings

Click to expand ##### Workspace ```json {} ``` ##### User ```json { "enableExperimentalFeatures": false, "enabledFeatures": { "codeActions": true, "diagnostics": true, "documentHighlights": true, "documentLink": true, "documentSymbols": true, "foldingRanges": true, "formatting": true, "hover": true, "inlayHint": true, "onTypeFormatting": true, "selectionRanges": true, "semanticHighlighting": true, "completion": true, "codeLens": true, "definition": true, "workspaceSymbol": true, "signatureHelp": true, "typeHierarchy": true }, "featuresConfiguration": {}, "addonSettings": {}, "rubyVersionManager": { "identifier": "auto" }, "customRubyCommand": "", "formatter": "auto", "linters": null, "bundleGemfile": "", "testTimeout": 30, "branch": "", "pullDiagnosticsOn": "both", "useBundlerCompose": false, "bypassTypechecker": false, "rubyExecutablePath": "/Users/alexanderpopov/.rbenv/shims/ruby", "indexing": {}, "erbSupport": true, "useLauncher": false, "featureFlags": {} } ```
vinistock commented 2 hours ago

Thank you for the report! Can you please try the just released v0.3.24? I believe this is the same as #512.