Shopify / Shopify/ruby-lsp

Boot loop when `.ruby-version` doesn't match in `Gemfile.lock`

Open
#2,711 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Description
Ruby LSP Information
Details

Ruby LSP Information
VS Code Version

1.94.0

Ruby LSP Extension Version

0.8.4

Ruby LSP Server Version

0.19.2

Ruby LSP Addons
Ruby Version

3.3.5

Ruby Version Manager

rbenv

Installed Extensions
Click to expand
  • gitlens (15.6.0)
  • go (0.42.1)
  • vscode-rdbg (0.2.2)
  • remote-containers (0.388.0)
  • material-icon-theme (5.11.1)
  • vscode-yaml (1.15.0)
  • ruby-lsp (0.8.4)
  • sorbet-vscode-extension (0.3.37)
  • vscode-wakatime (24.6.2)
Ruby LSP Settings
Click to expand
Workspace
{}
User
{
  "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": "none",
  "linters": null,
  "bundleGemfile": "",
  "testTimeout": 30,
  "branch": "",
  "pullDiagnosticsOn": "both",
  "useBundlerCompose": false,
  "bypassTypechecker": false,
  "rubyExecutablePath": "",
  "indexing": {},
  "erbSupport": true
}

Reproduction steps
# .ruby-version
3.3.5
# Gemfile
source "https://rubygems.org"

ruby file: ".ruby-version"
# Gemfile.lock
GEM
  remote: https://rubygems.org/
  specs:

PLATFORMS
  ruby
  x86_64-linux

DEPENDENCIES

RUBY VERSION
   ruby 3.3.4p94

BUNDLED WITH
   2.5.20

It successfully does its initial indexing but exits shortly after to restart, going back to indexing, exiting again, etc. You get the idea. There are no meaningful log lines in the extension output window.

This is cleary the error of whoever let those files get out of sync like that but I would expect the lsp to show a clear error message in that case.

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

Start by reproducing the mismatch among .ruby-version, Gemfile, and Gemfile.lock, then inspect the indexing and restart behavior using the extension output window. Done means the language server reports a clear Ruby-version mismatch and no longer repeatedly exits and restarts without a meaningful message.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.