Skip to content

rbenv not working properly #3270

@baelter

Description

@baelter

Description

rbenv version is not respected/loaded properly. Details below.

Ruby LSP Information

VS Code Version

1.97.2

Ruby LSP Extension Version

0.9.7

Ruby LSP Server Version

Unknown

Ruby LSP Add-ons

Ruby Version

3.3.5

Ruby Version Manager

rbenv

Installed Extensions

Click to expand
  • EditorConfig (0.17.1)
  • RunOnSave (0.2.7)
  • ansible (25.2.0)
  • auto-add-brackets (0.12.2)
  • code-spell-checker (4.0.40)
  • copilot (1.275.0)
  • copilot-chat (0.24.1)
  • crystal-ameba (0.2.1)
  • crystal-lang (0.9.7)
  • custom-local-formatters (0.1.1)
  • debug (0.27.0)
  • debugpy (2025.0.1)
  • dotenv (1.0.1)
  • doxdocgen (1.4.0)
  • errorlens (3.23.0)
  • gitlens (16.3.2)
  • haml (1.4.1)
  • haml-lint (0.2.1)
  • isort (2023.10.1)
  • jinjahtml (0.20.0)
  • makefile-tools (0.12.17)
  • markdown-mermaid (1.27.0)
  • mermaid-markdown-syntax-highlighting (1.7.0)
  • output-colorizer (0.1.2)
  • project-manager (12.8.0)
  • python (2025.0.0)
  • rainbow-csv (3.17.0)
  • remote-containers (0.397.0)
  • remote-explorer (0.4.3)
  • remote-ssh (0.117.1)
  • remote-wsl (0.88.5)
  • ruby-extensions-pack (0.1.13)
  • ruby-lsp (0.9.7)
  • shellcheck (0.37.7)
  • sorbet-vscode-extension (0.3.39)
  • systemd-unit-file (1.0.6)
  • terraform (2.34.3)
  • todo-tree (0.0.226)
  • vscode-eslint (3.0.10)
  • vscode-github-actions (0.27.1)
  • vscode-gradle (3.16.4)
  • vscode-html-css (2.0.13)
  • vscode-kubernetes-tools (1.3.20)
  • vscode-lldb (1.11.4)
  • vscode-markdownlint (0.59.0)
  • vscode-pull-request-github (0.104.1)
  • vscode-pylance (2025.2.1)
  • vscode-rdbg (0.2.2)
  • vscode-sort-json (1.20.0)
  • vscode-speech (0.12.1)
  • vscode-template-literal-editor (0.10.0)
  • vscode-yaml (1.16.0)
  • vsliveshare (1.0.5948)
  • workspacesort (1.6.2)

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,
  "branch": "",
  "pullDiagnosticsOn": "both",
  "useBundlerCompose": false,
  "bypassTypechecker": false,
  "rubyExecutablePath": "",
  "indexing": {},
  "erbSupport": true,
  "featureFlags": {},
  "sigOpacityLevel": "1"
}

Reproduction steps

  1. Start the Ruby LSP using vscode
  2. It will fail
  3. Clic "Bundle install" in the error message
  4. See unexpected behavior

Code snippet or error message

  bundle install
Your Ruby version is 3.3.5, but your Gemfile specified 3.3.7
  rbenv versions
  system
  3.2.2
  3.2.3
  3.2.4
* 3.3.5 (set by RBENV_VERSION environment variable)
  3.3.6
  3.3.7
  3.4.1
  cat .ruby-version
3.3.7

Seems ruby version is set by RBENV_VERSION and not .ruby-version.
I set up rbenv i .profile which is sourced by .zshrc like this:
eval "$(rbenv init -)".

Everything is working in my normal terminal.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingvscodeThis pull request should be included in the VS Code extension's release notes

    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