Skip to content

Problem with projects using different ruby versions opened in one workspace in VSC #4119

@ToniShingly

Description

@ToniShingly

Description

Ruby LSP Information

VS Code Version

1.121.0

Ruby LSP Extension Version

0.10.4

Ruby LSP Server Version

0.26.9

Ruby LSP Add-ons

  • Ruby LSP Rails (0.4.8)
  • RuboCop (unknown)

Ruby Version

3.0.2

Ruby Version Manager

rbenv

Installed Extensions

Click to expand
  • LiveServer (5.7.10)
  • debugpy (2026.6.0)
  • docker (0.18.0)
  • es7-react-js-snippets (4.4.3)
  • go (0.52.2)
  • makefile-tools (0.12.17)
  • markdown-preview-enhanced (0.8.27)
  • prisma (31.11.0)
  • python (2026.4.0)
  • remote-containers (0.459.0)
  • remote-wsl (0.104.3)
  • ruby-lsp (0.10.4)
  • todo-tree (0.0.226)
  • vs-code-prettier-eslint (6.0.0)
  • vscode-containers (2.4.4)
  • vscode-docker (2.0.0)
  • vscode-eslint (3.0.24)
  • vscode-pylance (2026.2.1)
  • vscode-tailwindcss (0.14.29)

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": "rbenv"
  },
  "customRubyCommand": "",
  "formatter": "auto",
  "linters": null,
  "bundleGemfile": "",
  "testTimeout": 30,
  "pullDiagnosticsOn": "both",
  "useBundlerCompose": false,
  "bypassTypechecker": false,
  "rubyExecutablePath": "",
  "indexing": {},
  "erbSupport": true,
  "featureFlags": {},
  "sigOpacityLevel": "1"
}

Reproduction steps

  1. Open VS Code.

  2. Add two different Ruby projects to the same workspace (Multi-root Workspace).

  3. Project A has .ruby-version set to 3.0.2.

  4. Project B has .ruby-version set to 3.3.x (or any other version).

  5. Ensure rubyLsp.rubyVersionManager is set to rbenv in User Settings.

  6. Wait for the Ruby LSP server to initialize.

Expected behavior

Ruby LSP should spin up two separate language server processes, each using the Ruby version specified in the respective project's .ruby-version file (leveraging rbenv context).

Actual behavior

Ruby LSP attempts to initialize for both projects using only one Ruby version (usually the one from the first project opened).

  • In the Output channel for Ruby LSP, I see that it tries to run bundle install or start the server for the second project using the wrong Ruby executable.
  • Syntax highlighting and constant resonance work for one project but fail for the other with "index out of bounds" or "failed to spawn" errors because of the version mismatch.
  • If I open these projects in separate VS Code windows, they work perfectly fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions