Shopify / ruby-lsp

An opinionated language server for Ruby
https://shopify.github.io/ruby-lsp/
MIT License
1.33k stars 118 forks source link

Failed to activate asdf environment: Unexpected token '/', "/bin/sh: 2"... is not valid JSON #1985

Closed kiran-4444 closed 2 weeks ago

kiran-4444 commented 2 weeks ago

Description

I'm using asdf version manager. I've setup ruby-lsp in vscode and using the following workspace config:

{
    "rubyLsp.bundleGemfile": "./Gemfile",
    "rubyLsp.formatter": "rubocop",
    "rubyLsp.rubyVersionManager": {
        "identifier": "asdf"
    },
    "rubyLsp.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
    }
}

But some how when I try to start the server, I get this error:

image

guicattani commented 2 weeks ago

Try updating your asdf installation :) with asdf update

cveneziani commented 2 weeks ago

I had the same issue, ran asdf update, restarted VS Code and now it's working fine. Thanks for the hint :pray: