Shopify / ruby-lsp

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

`--yjit` added to ruby command when not supported (with asdf usage) #2027

Open addbrick opened 3 weeks ago

addbrick commented 3 weeks ago

Description

Reproduction steps

I am using the vscode extension for a project running ruby 2.7.7, so I am following the separate Gemfile usage. The project uses asdf to manage ruby versions. This has been working great but it broke with the vscode extension version 0.5.20.

Now when I start the extension in this project, it shows an error /Users/addisonbrickey/.asdf/installs/ruby/2.7.7/bin/ruby: invalid option --yjit (-h will show valid options) (RuntimeError).

The core of the issue is the --yjit option is being added to the ruby command even though ruby 2.7.7 does not support it. I did notice in that release a manager for asdf was introduced https://github.com/Shopify/ruby-lsp/pull/1845 in 0.5.20. My project uses asdf so I assume that is part of the issue. Can see the code building the ruby command checks the ruby version number to ensure it supports yjit option.

vinistock commented 2 days ago

Thank you for the bug report. We released v0.7.0 with a few ASDF related fixes. Can you please try it and let us know if you find any issues?