Closed8

VSCode で Ruby LSP が起動できていないのをなんとかしたい(調査中断)

ピン留めされたアイテム
snakasnaka
snakasnaka

以下のエラーが出て起動に失敗している

Automatic Ruby environment activation with asdf failed: Unexpected end of JSON input
snakasnaka

OUTPUT の内容

2024-07-31 09:19:23.512 [info] (hoge) Running command: `. /opt/homebrew/opt/asdf/libexec/asdf.sh && asdf exec ruby -W0 -rjson -e 'STDERR.print({env: ENV.to_h,yjit:!!defined?(RubyVM::YJIT),version:RUBY_VERSION}.to_json)'` in /Users/xxx/projects/hoge using shell: /bin/bash
2024-07-31 09:19:23.633 [error] (hoge) Tried parsing invalid JSON environment: 
2024-07-31 09:24:27.542 [info] (hoge) Running command: `. /opt/homebrew/opt/asdf/libexec/asdf.sh && asdf exec ruby -W0 -rjson -e 'STDERR.print({env: ENV.to_h,yjit:!!defined?(RubyVM::YJIT),version:RUBY_VERSION}.to_json)'` in /Users/xxx/projects/hoge using shell: /bin/bash
2024-07-31 09:24:28.004 [error] (hoge) Tried parsing invalid JSON environment: 
2024-07-31 09:25:45.494 [info] (hoge) Running command: `. /opt/homebrew/opt/asdf/libexec/asdf.sh && asdf exec ruby -W0 -rjson -e 'STDERR.print({env: ENV.to_h,yjit:!!defined?(RubyVM::YJIT),version:RUBY_VERSION}.to_json)'` in /Users/xxx/projects/hoge using shell: /bin/bash
2024-07-31 09:25:45.563 [error] (hoge) Tried parsing invalid JSON environment: 
snakasnaka

OUTPUT のコマンドを実行してみる

asdf exec ruby -W0 -rjson -e 'STDERR.print({env: ENV.to_h,yjit:!!defined?(RubyVM::YJIT),version:RUBY_VERSION}.to_json)'
snakasnaka

環境変数は出せないが、JSONとしておかしいところは見当たらない...

{
  "env": {
    // (略)
    "TERM_PROGRAM": "vscode"
  },
  "yjit": false,
  "version": "3.1.6"
}
このスクラップは2024/08/21にクローズされました