ruby-lsp icon indicating copy to clipboard operation
ruby-lsp copied to clipboard

Fails to detect ruby and confusing error "No workspace found" in sentry-ruby devcontainer

Open solnic opened this issue 8 months ago • 2 comments

Description

Following up after https://bsky.app/profile/solnic.dev/post/3loix6q4xr62e

Reproduction steps

git clone https://github.com/getsentry/sentry-ruby.git
cd sentry-ruby
cp .devcontainer/.env.example .devcontainer/.env
code .

Then re-open in the devcontainer - our config is in .devcontainers dir. By default, the container is set up to grab bitnami/ruby docker image. Ruby is installed here:

$ which ruby   
/opt/bitnami/ruby/bin/ruby

This bin dir is in the PATH:

$ env | grep PATH | grep bitnami
PATH=/home/sentry/.bin:/vscode/vscode-server/bin/linux-arm64/17baf841131aa23349f217ca7c570c76ee87b957/bin/remote-cli:/home/sentry/.bin:/opt/bitnami/ruby/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/workspace/gems/3.4.2/bin:/home/sentry/.vscode-server/data/User/globalStorage/github.copilot-chat/debugCommand

Fails to run a test with confusing error

When trying to run a test, I get this:

Image

Expected Result

Either of the two:

  • IF it really cannot work with ruby under custom bin path, I would really expect to get a clear warning message that Ruby LSP did not manage to figure out where the ruby exec is, instead of "No workspace found" when running tests

OR, preferably:

  • Fix it to actually detect properly where ruby exec is - it's in the PATH, there's no ruby version manager involved, it's the simplest use-case scenario, so it'd be great if it just worked OOTB

Ruby LSP Information

VS Code Version

1.99.3

Ruby LSP Extension Version

0.9.21

Ruby LSP Server Version

0.23.17

Ruby LSP Add-ons

  • Ruby LSP RSpec
  • RuboCop

Ruby Version

3.4.2

Ruby Version Manager

auto

Installed Extensions

Click to expand
  • copilot (1.314.0)
  • copilot-chat (0.26.7)
  • magit (0.6.66)
  • ruby-lsp (0.9.21)
  • vscode-augment (0.436.0)
  • vscode-fileutils (3.10.3)
  • vscode-pull-request-github (0.109.2025041004)

Ruby LSP Settings

Click to expand
Workspace
{
  "rubyVersionManager": {
    "identifier": "auto"
  },
  "formatter": "rubocop"
}
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": "rubocop",
  "linters": null,
  "bundleGemfile": "",
  "testTimeout": 30,
  "branch": "",
  "pullDiagnosticsOn": "both",
  "useBundlerCompose": false,
  "bypassTypechecker": false,
  "rubyExecutablePath": "",
  "indexing": {},
  "erbSupport": true,
  "featureFlags": {},
  "sigOpacityLevel": "1"
}

solnic avatar May 08 '25 07:05 solnic

@vinistock you pinged me to report it so here it is - thanks for helping out!

@st0012 it's our sentry setup so maybe you could have some extra insights? 😄

solnic avatar May 08 '25 07:05 solnic

This issue is being marked as stale because there was no activity in the last 2 months

github-actions[bot] avatar Jul 21 '25 12:07 github-actions[bot]