Shopify / ruby-lsp

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

Avoid setting GEM_HOME and GEM_PATH for rbenv #1966

Closed vinistock closed 3 weeks ago

vinistock commented 3 weeks ago

Motivation

Closes #1947

Rbenv doesn't actually modify the GEM_HOME or GEM_PATH. It also doesn't add gem binary directories into the PATH. It follows a similar approach to ASDF by adding its shims directory into the PATH.

Implementation

We can rely on the env.PATH returned by the activation script directly, without setting anything manually. That should be enough to find the gem executables.

Automated Tests

Adapted our tests.