Open leewaa opened 2 weeks ago
Thank you for the bug report! I believe the issue is that the chruby
environment is not activated inside the process that runs Sublime Text, which is documented here under the important tip.
Essentially, chruby
mutates a few environment variables to allow ruby
and gem executables to properly find things. That happens in your terminal, but it does not happen inside the process running Sublime Text. The fact that it's trying to use Ruby 2.6 gives it away, because that's the system Ruby - the one available when no environment variables have been mutated.
Ensure that chruby is activating the environment before invoking ruby-lsp
in your command configuration. Instead of using simply ruby-lsp
, you need to either switch the version and then call the gem executable or use something like chruby-exec
. Something along the lines of
chruby $(cat .ruby-version) && ruby-lsp
Please report back if it works or if you encounter any issues. We will also gladly accept improvements to our editors documentation for better Sublime instructions.
Description
Reproduction steps
I cannot get ruby-lsp to work. IT fails to start, and judging from the trouble shoot output, there is something wrong with the environment it is running in, even though it seems to have the correct ENV with the paths set correctly. From the paths alone it looks like it uses the correct ruby, however the stack trace indicates is is trying to use ruby 2.6 somehow šµāš«??
Main points:
Using sublime text version 4180
Config:
Using chruby for ruby version management
launching sublime with subl from within a given project
subl
is part of myPATH
and not a symlink.ruby version is defined in a
.ruby-version
fileruby-lsp
part of my gemfile -ruby-lsp
installs without problems with bundle install (from a shell)ruby-lsp
command runs in my local environment without problems (from a shell)Troubleshooting: ruby-lsp
Version
Server Test Run
Server Configuration
Active view
Project / Workspace
LSP configuration
System PATH