Skip to content
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

System ruby fails to start LSP #3002

Open
rongcuid opened this issue Jan 2, 2025 · 5 comments
Open

System ruby fails to start LSP #3002

rongcuid opened this issue Jan 2, 2025 · 5 comments
Labels
bug Something isn't working vscode This pull request should be included in the VS Code extension's release notes

Comments

@rongcuid
Copy link

rongcuid commented Jan 2, 2025

Description

Note that the FAQ specifically says that vscode doesn't need a local gem installation of ruby-lsp.

Ruby LSP Information

VS Code Version

1.96.2

Ruby LSP Extension Version

0.8.16

Ruby LSP Server Version

Unknown

Ruby LSP Addons

Ruby Version

3.2.5

Ruby Version Manager

none

Installed Extensions

Click to expand
  • debugpy (2024.14.0)
  • errorlens (3.22.0)
  • jupyter (2024.11.0)
  • jupyter-keymap (1.1.2)
  • jupyter-renderers (1.0.21)
  • language-julia (1.127.2)
  • lean4 (0.0.186)
  • metals (1.45.0)
  • python (2024.22.1)
  • ruby-lsp (0.8.16)
  • rust-analyzer (0.3.2237)
  • scala (0.5.8)
  • vscode-lldb (1.11.1)
  • vscode-scheme-repl (0.7.4)
  • vscode-tlaplus (1.5.4)

Ruby LSP Settings

Click to expand
Workspace
{}
User
{
  "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": "",
  "indexing": {},
  "erbSupport": true,
  "featureFlags": {}
}

Reproduction steps

  1. Use a machine with system Ruby 3, no version manager
  2. Create a new project with a Gemfile
  3. bundle install
  4. Open project in VSCode
  5. Ruby LSP client: couldn't create connection to server.

Example Gemfile:

source "https://rubygems.org"

gem "sqlite3"
gem "tk"

group :development do
  gem "standard"
end

Code snippet or error message

2025-01-02 09:26:25.512 [info] (fate5d) Checking if chruby is available on the path with command: /bin/bash -i -c 'chruby --version'
2025-01-02 09:26:25.589 [info] (fate5d) Checking if rbenv is available on the path with command: /bin/bash -i -c 'rbenv --version'
2025-01-02 09:26:25.606 [info] (fate5d) Checking if rvm is available on the path with command: /bin/bash -i -c 'rvm --version'
2025-01-02 09:26:25.622 [info] (fate5d) Checking if asdf is available on the path with command: /bin/bash -i -c 'asdf --version'
2025-01-02 09:26:25.641 [info] (fate5d) Discovered version manager none
2025-01-02 09:26:25.641 [info] (fate5d) Running command: `ruby -W0 -rjson -e 'STDERR.print("RUBY_LSP_ACTIVATION_SEPARATOR" + { env: ENV.to_h, yjit: !!defined?(RubyVM::YJIT), version: RUBY_VERSION, gemPath: Gem.path }.to_json + "RUBY_LSP_ACTIVATION_SEPARATOR")'` in /home/rongcuid/src/fate5d using shell: /usr/bin/bash
2025-01-02 09:27:05.716 [info] (fate5d) [Error - 9:27:05 AM] Client Ruby LSP: connection to server is erroring.
write EPIPE
Shutting down server.
2025-01-02 09:27:05.716 [info] (fate5d) [Error - 9:27:05 AM] Client Ruby LSP: connection to server is erroring.
write EPIPE
Shutting down server.
2025-01-02 09:27:05.717 [info] (fate5d) [Error - 9:27:05 AM] Stopping server failed
2025-01-02 09:27:05.717 [info] (fate5d) Error: Client is not running and can't be stopped. It's current state is: starting
	at bs.shutdown (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:41:8468)
	at bs.stop (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:41:8047)
	at bs.stop (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:44:30480)
	at bs.handleConnectionError (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:43:63)
	at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
2025-01-02 09:27:05.717 [info] (fate5d) [Error - 9:27:05 AM] Stopping server failed
2025-01-02 09:27:05.717 [info] (fate5d) Error: Client is not running and can't be stopped. It's current state is: starting
	at bs.shutdown (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:41:8468)
	at bs.stop (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:41:8047)
	at bs.stop (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:44:30480)
	at bs.handleConnectionError (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:43:63)
	at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
2025-01-02 09:27:05.717 [info] (fate5d) [Error - 9:27:05 AM] Server initialization failed.
2025-01-02 09:27:05.717 [info] (fate5d)   Message: write EPIPE
  Code: -32099 
2025-01-02 09:27:05.717 [info] (fate5d) [Error - 9:27:05 AM] Ruby LSP client: couldn't create connection to server.
2025-01-02 09:27:05.717 [info] (fate5d)   Message: write EPIPE
  Code: -32099 
2025-01-02 09:27:05.717 [error] (fate5d) Error starting the server: write EPIPE
2025-01-02 09:27:05.719 [info] (fate5d) /bin/sh: line 1: ruby-lsp: command not found

2025-01-02 09:27:05.719 [info] (fate5d) [Error - 9:27:05 AM] Server process exited with code 127.
2025-01-02 09:30:57.201 [info] (fate5d) Restarting the Ruby LSP because /home/rongcuid/src/fate5d/Gemfile.lock changed, matching {Gemfile.lock,gems.locked,.rubocop.yml,.rubocop}
2025-01-02 09:30:57.201 [error] (fate5d) Error restarting the server: Client is not running and can't be stopped. It's current state is: startFailed
2025-01-02 09:31:18.792 [info] (fate5d) Checking if chruby is available on the path with command: /bin/bash -i -c 'chruby --version'
2025-01-02 09:31:18.809 [info] (fate5d) Checking if rbenv is available on the path with command: /bin/bash -i -c 'rbenv --version'
2025-01-02 09:31:18.826 [info] (fate5d) Checking if rvm is available on the path with command: /bin/bash -i -c 'rvm --version'
2025-01-02 09:31:18.844 [info] (fate5d) Checking if asdf is available on the path with command: /bin/bash -i -c 'asdf --version'
2025-01-02 09:31:18.863 [info] (fate5d) Discovered version manager none
2025-01-02 09:31:18.863 [info] (fate5d) Running command: `ruby -W0 -rjson -e 'STDERR.print("RUBY_LSP_ACTIVATION_SEPARATOR" + { env: ENV.to_h, yjit: !!defined?(RubyVM::YJIT), version: RUBY_VERSION, gemPath: Gem.path }.to_json + "RUBY_LSP_ACTIVATION_SEPARATOR")'` in /home/rongcuid/src/fate5d using shell: /usr/bin/bash
2025-01-02 09:31:19.143 [info] (fate5d) [Error - 9:31:19 AM] Client Ruby LSP: connection to server is erroring.
write EPIPE
Shutting down server.
2025-01-02 09:31:19.143 [info] (fate5d) [Error - 9:31:19 AM] Client Ruby LSP: connection to server is erroring.
write EPIPE
Shutting down server.
2025-01-02 09:31:19.143 [info] (fate5d) [Error - 9:31:19 AM] Stopping server failed
2025-01-02 09:31:19.143 [info] (fate5d) Error: Client is not running and can't be stopped. It's current state is: starting
	at bs.shutdown (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:41:8468)
	at bs.stop (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:41:8047)
	at bs.stop (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:44:30480)
	at bs.handleConnectionError (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:43:63)
	at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
2025-01-02 09:31:19.143 [info] (fate5d) [Error - 9:31:19 AM] Stopping server failed
2025-01-02 09:31:19.143 [info] (fate5d) Error: Client is not running and can't be stopped. It's current state is: starting
	at bs.shutdown (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:41:8468)
	at bs.stop (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:41:8047)
	at bs.stop (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:44:30480)
	at bs.handleConnectionError (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:43:63)
	at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
2025-01-02 09:31:19.144 [info] (fate5d) [Error - 9:31:19 AM] Server initialization failed.
2025-01-02 09:31:19.144 [info] (fate5d)   Message: write EPIPE
  Code: -32099 
2025-01-02 09:31:19.144 [info] (fate5d) [Error - 9:31:19 AM] Ruby LSP client: couldn't create connection to server.
2025-01-02 09:31:19.144 [info] (fate5d)   Message: write EPIPE
  Code: -32099 
2025-01-02 09:31:19.144 [error] (fate5d) Error starting the server: write EPIPE
2025-01-02 09:31:19.146 [info] (fate5d) /bin/sh: line 1: ruby-lsp: command not found

2025-01-02 09:31:19.146 [info] (fate5d) [Error - 9:31:19 AM] Server process exited with code 127.
2025-01-02 09:31:39.100 [info] (fate5d) Checking if chruby is available on the path with command: /bin/bash -i -c 'chruby --version'
2025-01-02 09:31:39.118 [info] (fate5d) Checking if rbenv is available on the path with command: /bin/bash -i -c 'rbenv --version'
2025-01-02 09:31:39.138 [info] (fate5d) Checking if rvm is available on the path with command: /bin/bash -i -c 'rvm --version'
2025-01-02 09:31:39.158 [info] (fate5d) Checking if asdf is available on the path with command: /bin/bash -i -c 'asdf --version'
2025-01-02 09:31:39.182 [info] (fate5d) Discovered version manager none
2025-01-02 09:31:39.182 [info] (fate5d) Running command: `ruby -W0 -rjson -e 'STDERR.print("RUBY_LSP_ACTIVATION_SEPARATOR" + { env: ENV.to_h, yjit: !!defined?(RubyVM::YJIT), version: RUBY_VERSION, gemPath: Gem.path }.to_json + "RUBY_LSP_ACTIVATION_SEPARATOR")'` in /home/rongcuid/src/fate5d using shell: /usr/bin/bash
2025-01-02 09:31:39.483 [info] (fate5d) [Error - 9:31:39 AM] Client Ruby LSP: connection to server is erroring.
write EPIPE
Shutting down server.
2025-01-02 09:31:39.483 [info] (fate5d) [Error - 9:31:39 AM] Client Ruby LSP: connection to server is erroring.
write EPIPE
Shutting down server.
2025-01-02 09:31:39.484 [info] (fate5d) [Error - 9:31:39 AM] Stopping server failed
2025-01-02 09:31:39.484 [info] (fate5d) Error: Client is not running and can't be stopped. It's current state is: starting
	at bs.shutdown (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:41:8468)
	at bs.stop (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:41:8047)
	at bs.stop (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:44:30480)
	at bs.handleConnectionError (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:43:63)
	at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
2025-01-02 09:31:39.484 [info] (fate5d) [Error - 9:31:39 AM] Stopping server failed
2025-01-02 09:31:39.484 [info] (fate5d) Error: Client is not running and can't be stopped. It's current state is: starting
	at bs.shutdown (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:41:8468)
	at bs.stop (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:41:8047)
	at bs.stop (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:44:30480)
	at bs.handleConnectionError (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:43:63)
	at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
2025-01-02 09:31:39.484 [info] (fate5d) [Error - 9:31:39 AM] Server initialization failed.
2025-01-02 09:31:39.484 [info] (fate5d)   Message: write EPIPE
  Code: -32099 
2025-01-02 09:31:39.485 [info] (fate5d) [Error - 9:31:39 AM] Ruby LSP client: couldn't create connection to server.
2025-01-02 09:31:39.485 [info] (fate5d)   Message: write EPIPE
  Code: -32099 
2025-01-02 09:31:39.485 [error] (fate5d) Error starting the server: write EPIPE
2025-01-02 09:31:39.486 [info] (fate5d) /bin/sh: line 1: ruby-lsp: command not found

2025-01-02 09:31:39.487 [info] (fate5d) [Error - 9:31:39 AM] Server process exited with code 127.
2025-01-02 09:31:48.074 [info] (fate5d) Checking if chruby is available on the path with command: /bin/bash -i -c 'chruby --version'
2025-01-02 09:31:48.101 [info] (fate5d) Checking if rbenv is available on the path with command: /bin/bash -i -c 'rbenv --version'
2025-01-02 09:31:48.121 [info] (fate5d) Checking if rvm is available on the path with command: /bin/bash -i -c 'rvm --version'
2025-01-02 09:31:48.138 [info] (fate5d) Checking if asdf is available on the path with command: /bin/bash -i -c 'asdf --version'
2025-01-02 09:31:48.157 [info] (fate5d) Discovered version manager none
2025-01-02 09:31:48.158 [info] (fate5d) Running command: `ruby -W0 -rjson -e 'STDERR.print("RUBY_LSP_ACTIVATION_SEPARATOR" + { env: ENV.to_h, yjit: !!defined?(RubyVM::YJIT), version: RUBY_VERSION, gemPath: Gem.path }.to_json + "RUBY_LSP_ACTIVATION_SEPARATOR")'` in /home/rongcuid/src/fate5d using shell: /usr/bin/bash
2025-01-02 09:31:48.415 [info] (fate5d) [Error - 9:31:48 AM] Client Ruby LSP: connection to server is erroring.
write EPIPE
Shutting down server.
2025-01-02 09:31:48.415 [info] (fate5d) [Error - 9:31:48 AM] Client Ruby LSP: connection to server is erroring.
write EPIPE
Shutting down server.
2025-01-02 09:31:48.415 [info] (fate5d) [Error - 9:31:48 AM] Stopping server failed
2025-01-02 09:31:48.415 [info] (fate5d) Error: Client is not running and can't be stopped. It's current state is: starting
	at bs.shutdown (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:41:8468)
	at bs.stop (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:41:8047)
	at bs.stop (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:44:30480)
	at bs.handleConnectionError (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:43:63)
	at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
2025-01-02 09:31:48.415 [info] (fate5d) [Error - 9:31:48 AM] Stopping server failed
2025-01-02 09:31:48.415 [info] (fate5d) Error: Client is not running and can't be stopped. It's current state is: starting
	at bs.shutdown (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:41:8468)
	at bs.stop (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:41:8047)
	at bs.stop (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:44:30480)
	at bs.handleConnectionError (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:43:63)
	at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
2025-01-02 09:31:48.416 [info] (fate5d) [Error - 9:31:48 AM] Server initialization failed.
2025-01-02 09:31:48.416 [info] (fate5d)   Message: write EPIPE
  Code: -32099 
2025-01-02 09:31:48.416 [info] (fate5d) [Error - 9:31:48 AM] Ruby LSP client: couldn't create connection to server.
2025-01-02 09:31:48.416 [info] (fate5d)   Message: write EPIPE
  Code: -32099 
2025-01-02 09:31:48.416 [error] (fate5d) Error starting the server: write EPIPE
2025-01-02 09:31:48.417 [info] (fate5d) /bin/sh: line 1: ruby-lsp: command not found

2025-01-02 09:31:48.418 [info] (fate5d) [Error - 9:31:48 AM] Server process exited with code 127.
2025-01-02 09:33:47.730 [info] (fate5d) [Info  - 9:33:47 AM] Connection to server got closed. Server will restart.
2025-01-02 09:33:47.730 [info] (fate5d) false
2025-01-02 09:33:47.737 [info] (fate5d) [Error - 9:33:47 AM] Client Ruby LSP: connection to server is erroring.
write EPIPE
Shutting down server.
2025-01-02 09:33:47.737 [info] (fate5d) [Error - 9:33:47 AM] Stopping server failed
2025-01-02 09:33:47.737 [info] (fate5d) Error: Client is not running and can't be stopped. It's current state is: starting
	at bs.shutdown (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:41:8468)
	at bs.stop (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:41:8047)
	at bs.stop (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:44:30480)
	at bs.handleConnectionError (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:43:63)
	at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
2025-01-02 09:33:47.737 [info] (fate5d) [Error - 9:33:47 AM] Server initialization failed.
2025-01-02 09:33:47.737 [info] (fate5d)   Message: write EPIPE
  Code: -32099 
2025-01-02 09:33:47.738 [info] (fate5d) [Error - 9:33:47 AM] Ruby LSP client: couldn't create connection to server.
2025-01-02 09:33:47.738 [info] (fate5d)   Message: write EPIPE
  Code: -32099 
2025-01-02 09:33:47.738 [info] (fate5d) [Error - 9:33:47 AM] Restarting server failed
2025-01-02 09:33:47.738 [info] (fate5d)   Message: write EPIPE
  Code: -32099 
2025-01-02 09:33:47.738 [info] (fate5d) /bin/sh: line 1: ruby-lsp: command not found

2025-01-02 09:33:47.739 [info] (fate5d) [Error - 9:33:47 AM] Server process exited with code 127.
2025-01-02 09:33:54.707 [info] (fate5d) Checking if chruby is available on the path with command: /bin/bash -i -c 'chruby --version'
2025-01-02 09:33:54.725 [info] (fate5d) Checking if rbenv is available on the path with command: /bin/bash -i -c 'rbenv --version'
2025-01-02 09:33:54.743 [info] (fate5d) Checking if rvm is available on the path with command: /bin/bash -i -c 'rvm --version'
2025-01-02 09:33:54.763 [info] (fate5d) Checking if asdf is available on the path with command: /bin/bash -i -c 'asdf --version'
2025-01-02 09:33:54.801 [info] (fate5d) Discovered version manager none
2025-01-02 09:33:54.801 [info] (fate5d) Running command: `ruby -W0 -rjson -e 'STDERR.print("RUBY_LSP_ACTIVATION_SEPARATOR" + { env: ENV.to_h, yjit: !!defined?(RubyVM::YJIT), version: RUBY_VERSION, gemPath: Gem.path }.to_json + "RUBY_LSP_ACTIVATION_SEPARATOR")'` in /home/rongcuid/src/fate5d using shell: /usr/bin/bash
2025-01-02 09:33:55.063 [info] (fate5d) [Error - 9:33:55 AM] Client Ruby LSP: connection to server is erroring.
write EPIPE
Shutting down server.
2025-01-02 09:33:55.063 [info] (fate5d) [Error - 9:33:55 AM] Client Ruby LSP: connection to server is erroring.
write EPIPE
Shutting down server.
2025-01-02 09:33:55.064 [info] (fate5d) [Error - 9:33:55 AM] Stopping server failed
2025-01-02 09:33:55.064 [info] (fate5d) Error: Client is not running and can't be stopped. It's current state is: starting
	at bs.shutdown (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:41:8468)
	at bs.stop (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:41:8047)
	at bs.stop (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:44:30480)
	at bs.handleConnectionError (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:43:63)
	at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
2025-01-02 09:33:55.064 [info] (fate5d) [Error - 9:33:55 AM] Stopping server failed
2025-01-02 09:33:55.064 [info] (fate5d) Error: Client is not running and can't be stopped. It's current state is: starting
	at bs.shutdown (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:41:8468)
	at bs.stop (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:41:8047)
	at bs.stop (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:44:30480)
	at bs.handleConnectionError (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:43:63)
	at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
2025-01-02 09:33:55.065 [info] (fate5d) [Error - 9:33:55 AM] Server initialization failed.
2025-01-02 09:33:55.065 [info] (fate5d)   Message: write EPIPE
  Code: -32099 
2025-01-02 09:33:55.065 [info] (fate5d) [Error - 9:33:55 AM] Ruby LSP client: couldn't create connection to server.
2025-01-02 09:33:55.065 [info] (fate5d)   Message: write EPIPE
  Code: -32099 
2025-01-02 09:33:55.065 [error] (fate5d) Error starting the server: write EPIPE
2025-01-02 09:33:55.067 [info] (fate5d) /bin/sh: line 1: ruby-lsp: command not found

2025-01-02 09:33:55.067 [info] (fate5d) [Error - 9:33:55 AM] Server process exited with code 127.
2025-01-02 09:35:08.832 [info] (fate5d) Checking if chruby is available on the path with command: /bin/bash -i -c 'chruby --version'
2025-01-02 09:35:08.849 [info] (fate5d) Checking if rbenv is available on the path with command: /bin/bash -i -c 'rbenv --version'
2025-01-02 09:35:08.868 [info] (fate5d) Checking if rvm is available on the path with command: /bin/bash -i -c 'rvm --version'
2025-01-02 09:35:08.888 [info] (fate5d) Checking if asdf is available on the path with command: /bin/bash -i -c 'asdf --version'
2025-01-02 09:35:08.929 [info] (fate5d) Discovered version manager none
2025-01-02 09:35:08.929 [info] (fate5d) Running command: `ruby -W0 -rjson -e 'STDERR.print("RUBY_LSP_ACTIVATION_SEPARATOR" + { env: ENV.to_h, yjit: !!defined?(RubyVM::YJIT), version: RUBY_VERSION, gemPath: Gem.path }.to_json + "RUBY_LSP_ACTIVATION_SEPARATOR")'` in /home/rongcuid/src/fate5d using shell: /usr/bin/bash
2025-01-02 09:35:09.186 [info] (fate5d) [Error - 9:35:09 AM] Client Ruby LSP: connection to server is erroring.
write EPIPE
Shutting down server.
2025-01-02 09:35:09.186 [info] (fate5d) [Error - 9:35:09 AM] Client Ruby LSP: connection to server is erroring.
write EPIPE
Shutting down server.
2025-01-02 09:35:09.187 [info] (fate5d) [Error - 9:35:09 AM] Stopping server failed
2025-01-02 09:35:09.187 [info] (fate5d) Error: Client is not running and can't be stopped. It's current state is: starting
	at bs.shutdown (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:41:8468)
	at bs.stop (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:41:8047)
	at bs.stop (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:44:30480)
	at bs.handleConnectionError (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:43:63)
	at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
2025-01-02 09:35:09.187 [info] (fate5d) [Error - 9:35:09 AM] Stopping server failed
2025-01-02 09:35:09.187 [info] (fate5d) Error: Client is not running and can't be stopped. It's current state is: starting
	at bs.shutdown (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:41:8468)
	at bs.stop (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:41:8047)
	at bs.stop (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:44:30480)
	at bs.handleConnectionError (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:43:63)
	at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
2025-01-02 09:35:09.187 [info] (fate5d) [Error - 9:35:09 AM] Server initialization failed.
2025-01-02 09:35:09.187 [info] (fate5d)   Message: write EPIPE
  Code: -32099 
2025-01-02 09:35:09.187 [info] (fate5d) [Error - 9:35:09 AM] Ruby LSP client: couldn't create connection to server.
2025-01-02 09:35:09.187 [info] (fate5d)   Message: write EPIPE
  Code: -32099 
2025-01-02 09:35:09.188 [error] (fate5d) Error starting the server: write EPIPE
2025-01-02 09:35:09.189 [info] (fate5d) /bin/sh: line 1: ruby-lsp: command not found

2025-01-02 09:35:09.189 [info] (fate5d) [Error - 9:35:09 AM] Server process exited with code 127.
2025-01-02 09:35:13.118 [info] (fate5d) [Info  - 9:35:13 AM] Connection to server got closed. Server will restart.
2025-01-02 09:35:13.119 [info] (fate5d) false
2025-01-02 09:35:13.124 [info] (fate5d) /bin/sh: line 1: ruby-lsp: command not found

2025-01-02 09:35:13.124 [info] (fate5d) [Error - 9:35:13 AM] Server process exited with code 127.
2025-01-02 09:35:13.124 [info] (fate5d) [Error - 9:35:13 AM] Server initialization failed.
2025-01-02 09:35:13.124 [info] (fate5d)   Message: Pending response rejected since connection got disposed
  Code: -32097 
2025-01-02 09:35:13.124 [info] (fate5d) [Error - 9:35:13 AM] Ruby LSP client: couldn't create connection to server.
2025-01-02 09:35:13.125 [info] (fate5d)   Message: Pending response rejected since connection got disposed
  Code: -32097 
2025-01-02 09:35:13.125 [info] (fate5d) [Error - 9:35:13 AM] Restarting server failed
2025-01-02 09:35:13.125 [info] (fate5d)   Message: Pending response rejected since connection got disposed
  Code: -32097 
2025-01-02 09:41:17.735 [info] (fate5d) Checking if chruby is available on the path with command: /bin/bash -i -c 'chruby --version'
2025-01-02 09:41:17.755 [info] (fate5d) Checking if rbenv is available on the path with command: /bin/bash -i -c 'rbenv --version'
2025-01-02 09:41:17.776 [info] (fate5d) Checking if rvm is available on the path with command: /bin/bash -i -c 'rvm --version'
2025-01-02 09:41:17.793 [info] (fate5d) Checking if asdf is available on the path with command: /bin/bash -i -c 'asdf --version'
2025-01-02 09:41:17.818 [info] (fate5d) Discovered version manager none
2025-01-02 09:41:17.818 [info] (fate5d) Running command: `ruby -W0 -rjson -e 'STDERR.print("RUBY_LSP_ACTIVATION_SEPARATOR" + { env: ENV.to_h, yjit: !!defined?(RubyVM::YJIT), version: RUBY_VERSION, gemPath: Gem.path }.to_json + "RUBY_LSP_ACTIVATION_SEPARATOR")'` in /home/rongcuid/src/fate5d using shell: /usr/bin/bash
2025-01-02 09:41:18.083 [info] (fate5d) [Error - 9:41:18 AM] Client Ruby LSP: connection to server is erroring.
write EPIPE
Shutting down server.
2025-01-02 09:41:18.083 [info] (fate5d) [Error - 9:41:18 AM] Client Ruby LSP: connection to server is erroring.
write EPIPE
Shutting down server.
2025-01-02 09:41:18.083 [info] (fate5d) [Error - 9:41:18 AM] Stopping server failed
2025-01-02 09:41:18.083 [info] (fate5d) Error: Client is not running and can't be stopped. It's current state is: starting
	at bs.shutdown (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:41:8468)
	at bs.stop (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:41:8047)
	at bs.stop (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:44:30480)
	at bs.handleConnectionError (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:43:63)
	at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
2025-01-02 09:41:18.083 [info] (fate5d) [Error - 9:41:18 AM] Stopping server failed
2025-01-02 09:41:18.083 [info] (fate5d) Error: Client is not running and can't be stopped. It's current state is: starting
	at bs.shutdown (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:41:8468)
	at bs.stop (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:41:8047)
	at bs.stop (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:44:30480)
	at bs.handleConnectionError (/home/rongcuid/.vscode-oss/extensions/shopify.ruby-lsp-0.8.16-universal/out/extension.js:43:63)
	at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
2025-01-02 09:41:18.084 [info] (fate5d) [Error - 9:41:18 AM] Server initialization failed.
2025-01-02 09:41:18.084 [info] (fate5d)   Message: write EPIPE
  Code: -32099 
2025-01-02 09:41:18.084 [info] (fate5d) [Error - 9:41:18 AM] Ruby LSP client: couldn't create connection to server.
2025-01-02 09:41:18.084 [info] (fate5d)   Message: write EPIPE
  Code: -32099 
2025-01-02 09:41:18.085 [error] (fate5d) Error starting the server: write EPIPE
2025-01-02 09:41:18.086 [info] (fate5d) /bin/sh: line 1: ruby-lsp: command not found

2025-01-02 09:41:18.086 [info] (fate5d) [Error - 9:41:18 AM] Server process exited with code 127.
@rongcuid rongcuid added bug Something isn't working vscode This pull request should be included in the VS Code extension's release notes labels Jan 2, 2025
@vinistock
Copy link
Member

Thank you for the bug report!

Note that the FAQ specifically says that vscode doesn't need a local gem installation of ruby-lsp.

Can you point to where we say that? If we say it like that, then it's a mistake. You don't have to add ruby-lsp to your bundle, but we definitely need to be able to install the ruby-lsp gem automatically for you otherwise the executable won't be there for us to launch the server.

Regarding the issue you're experiencing, I suspect it's related to the fact that you are not using a version manager and the VS Code NodeJS process likely doesn't know about the Ruby you installed manually. How did you install Ruby? And how do you add the Ruby installation to your PATH?

@rongcuid
Copy link
Author

rongcuid commented Jan 2, 2025

Can you point to where we say that? If we say it like that, then it's a mistake.

https://shopify.github.io/ruby-lsp/editors.html

This file contains community driven instructions on how to set up the Ruby LSP in editors other than VS Code. For VS Code, use the official Ruby LSP extension.

I might have interpreted this sentence incorrectly.

I was trying to use the system installed Ruby, which is under /usr/bin.

@vinistock
Copy link
Member

Do you need sudo to install gems with that system Ruby? If so, the Ruby LSP will unfortunately not work as the process doesn't run with sudo permissions and we need to be able to install gems.

We do offer options to point to a specific Ruby executable, but it will only work if sudo is not required.

@rongcuid
Copy link
Author

rongcuid commented Jan 2, 2025

I need sudo to install ruby-lsp. gem install --user-install somehow gives me an error saying my --install-path is also set, despite me not setting it, so I am not sure if that will work.

@vinistock
Copy link
Member

We have some instructions on how to configure RubyGems and Bundler to install gems in specific places and to use user-install to avoid permission issues.

Do those options work for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working vscode This pull request should be included in the VS Code extension's release notes
Projects
None yet
Development

No branches or pull requests

2 participants