Shopify / Shopify/ruby-lsp

Run `bundle install` if Gemfile but no `Gemfile.lock`

Open
#1,944 6 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Description
Reproduction steps

Check out a fresh copy of a repo with Gemfile.lock in .gitignore (rubocop/rubocop for example).

The LSP starting will first show a notice about mulitroot workspaces and after discarding that refuse to start with the following:

Project contains a Gemfile, but no Gemfile.lock. Run bundle install to lock gems and restart the server

Would it make sense to automatically run bundle install for the user in these cases? This would probably require explicit user confirmation, similarly to how VSCode asks about trusted folders. Gems may execute arbitrary commands during installation (I think, especially C extensions during compilation). Perhaps the confirmation of VSCode is already enough, if the extension isn't opting in to trusted mode, https://code.visualstudio.com/docs/editor/workspace-trust. I believe that is the case currently, however looks to be vscode specific and not part of the LSP protocol.

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 startup failure with a fresh checkout containing a Gemfile but no Gemfile.lock, as described in the issue. Review the Ruby LSP startup path and its VS Code workspace-trust integration; done means defining and implementing a safe confirmation flow for running bundle install, with coverage for the missing-lockfile case.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby, vscode
Domain
devtools, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.