Shopify / Shopify/ruby-lsp

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

Open
#4,119 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Stale
Dominant language
Ruby
Stars
2k
Forks
281
Avg merge
2h 14m
Merged PRs (30d)
6

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the multi-root workspace with separate .ruby-version files and inspect the Ruby LSP Output channel during initialization. Trace how each project is associated with its Ruby executable and verify that both projects start successfully with their own versions, matching the separate-window behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby, vscode
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.