Shopify / ruby-lsp

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

Seems to be looking for gems in the wrong place #1248

Closed hahuang65 closed 2 weeks ago

hahuang65 commented 5 months ago

Ruby version

3.1.4

Code snippet

No response

Description

In ruby-lsp 0.13.1, when I run it, it'll think prism is missing, install it successfully to my local bundle, then fail to find it:

/Users/hhhuang/.local/share/nvim/mason/bin/ruby-lsp
Ruby LSP> Skipping custom bundle setup since /Users/hhhuang/Documents/Projects/a5/crm/.ruby-lsp/Gemfile.lock already exists and is up to date
Ruby LSP> Running bundle install for the custom bundle. This may take a while...
Ruby LSP> Command: (bundle check || bundle install) 1>&2
The following gems are missing
 * prism (0.18.0)
Install missing gems with `bundle install`
Fetching gem metadata from https://rubygems.org/.......
Installing prism 0.18.0 with native extensions
Bundle complete! 102 Gemfile dependencies, 619 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
1 installed gem you directly depend on is looking for funding.
  Run `bundle fund` for details
Could not find prism-0.18.0 in locally installed gems
Run `bundle install` to install missing gems.

You can see it is installed here

$ gem list | grep prism
prism (0.18.0)

But it's not in bundle info.

Expected output

Running ruby-lsp should properly install the gems it requires, and then be able to find it afterward.

vinistock commented 5 months ago

Thank you for the bug report! Some questions to help understand what's happening.

  1. Is this using the preview release of the VS Code extension?
  2. What version manager do you use?
  3. In your terminal, with your Ruby version properly activated, what does this print?
    ruby -e 'puts [Gem.user_dir, Gem.default_dir]'
hahuang65 commented 5 months ago

@vinistock thanks for the quick response. I just realized, it's a little more complicated.

I'm not using this in VS Code. I'm using it in Neovim. It's not the preview release. It's just 0.13.1.

It's actually installed using a neovim package manager called mason: https://github.com/mason-org/mason-registry/blob/main/packages/ruby-lsp/package.yaml

I'm using asdf as my version manager for ruby

To answer question 3:

/Users/hhhuang/.gem/ruby/3.1.0
/Users/hhhuang/.asdf/installs/ruby/3.1.4/lib/ruby/gems/3.1.0

I'm certain that mason is NOT running my asdf ruby version (which is 3.1.4).. that said, should that actually matter?

ruby-lsp is supposed to be self-contained correct? If I'm able to install ruby-lsp, it should be able to install and find it's own dependencies, regardless of if I'm in a bundler project, or just working on a single .rb file?

What's a bit confusing to me is that it seems to be installing prism, but then it doesn't look for the gem in the same place?

vinistock commented 5 months ago

I'm certain that mason is NOT running my asdf ruby version (which is 3.1.4).. that said, should that actually matter?

This might be the issue. Depending on how you install the ruby-lsp, it might be installed in one GEM_HOME and then when it tries to execute it picks up a different one (thus not finding the gems).

FWIW, in the VS Code extension we always activate the environment before launching the server to ensure that the right Ruby environment variables are set.

You could try to change your launch configuration to activate the asdf environment first and see if that solves the issue (which indicates that indeed the GEM_HOME changed between installing and executing the gem).

I don't know asdf, but something like

# No idea if the command exists, but you get the gist
asdf use 3.1.4 && ruby-lsp

# With chruby it would be
chruby 3.1.4 && ruby-lsp
hahuang65 commented 5 months ago

@vinistock that's been my workaround. I can use ~/.asdf/shims/ruby-lsp, but this involves installing ruby-lsp to each ruby version that I have installed with asdf.

I was hoping, because nvim-mason does install ruby-lsp globally, I could use that, since it would make my neovim setup much more portable.

In my mind, it seemed like ruby-lsp could be installed globally, as it's a standalone gem, and not one that needs to be included in a bundle.

Needing to install ruby-lsp with each Ruby version sort of negates that benefit.

vinistock commented 5 months ago

The Ruby LSP connects to your project's bundle to identify which formatter/linter you are using and which gems to index for hover, definition and completion.

That's why we always recommend running the server with the same Ruby version as your current project. Otherwise, booting the server could fail if you have a gem that doesn't support the Ruby version you are currently running with.

If you use a global installation, it might work as long as the gems on your projects are all compatible with that Ruby version. But because we need to have access to the gems, we need the bundle to be satisfied so that Bundler adds all of their paths into the $LOAD_PATH. Which means we need to install the project gems under your global installation.

If the project's Ruby version doesn't match the global version, then when you boot the LSP with the global one it'll identify that some gems aren't installed on that version, triggering it to install them.

For example, if you use RuboCop with extensions (e.g.: rubocop-performance, rubocop-rails, etc), there's no way we could provide formatting unless we had the bundle fully satisfied. We need RuboCop and all its extensions to be installed, so that we can format using the exact same configuration your project has.

TvL2386 commented 4 months ago

I had the same issue. I use rbenv on ubuntu. My fix was updating cmd:

local capabilities = require('cmp_nvim_lsp').default_capabilities()
local lsp_config = require("lspconfig")

lsp_config.ruby_ls.setup {
  capabilities = capabilities,
  cmd = {"/home/my_user/.rbenv/shims/ruby-lsp"},
}

The ruby-lsp now won't crash anymore, and it won't need to install the bundle for the default ruby version:

"Ruby LSP> Skipping custom bundle setup since /home/my_user/RubyProjects/my_project/.ruby-lsp/Gemfile.lock already exists and is up to date\n"
"Ruby LSP> Running bundle install for the custom bundle. This may take a while...\nRuby LSP> Command: (bundle check || bundle install)
"The Gemfile's dependencies are satisfied\n"                                                       
"Starting Ruby LSP v0.13.4...\n"                                                       
"Ruby LSP is ready\n"                                                       
samtgarson commented 3 months ago

@hahuang65 I hit a similar issue using asdf. It seems to be fixed by adding

cmd = { "/Users/samgarson/.asdf/shims/ruby-lsp" }

to the lspconfig setup for ruby_ls

vinistock commented 3 months ago

I think it makes sense to use the shim executable. I suppose it probably points to whatever Ruby version is currently activated, which is basically the same approach we take in the VS Code extension.

Does someone want to contribute a section explaining this in https://github.com/Shopify/ruby-lsp/blob/main/EDITORS.md? I think it's worth pointing out in the documentation for clients that need to configure the command they execute.

alexventuraio commented 3 months ago

Same as the OP of this issue, I got this error when trying to set ruby-lsp for Neovim editor with mason and mason-lspconfig:

Ruby Version: 3.1.4 NeoVim version: NVIM v0.9.5 Version manager: RVM 1.29.12-next OS: MacOS Sonoma 14.2.1

See logs from LspLogs: ```javascript [START][2024-02-27 22:22:55] LSP logging initiated [ERROR][2024-02-27 22:22:55] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Ignoring prism-0.24.0 because its extensions are not built. Try: gem pristine prism --version 0.24.0\n" [ERROR][2024-02-27 22:22:55] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Ignoring prism-0.24.0 because its extensions are not built. Try: gem pristine prism --version 0.24.0\n" [ERROR][2024-02-27 22:22:55] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Ruby LSP> Skipping custom bundle setup since /Users/alex/Workspace/trello_project/.ruby-lsp/Gemfile.lock already exists and is up to date\n" [ERROR][2024-02-27 22:22:55] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Ruby LSP> Running bundle install for the custom bundle. This may take a while...\nRuby LSP> Command: (bundle check || bundle install) 1>&2\n" [ERROR][2024-02-27 22:22:56] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "The following gems are missing\n * prism (0.24.0)\nInstall missing gems with `bundle install`\n" [ERROR][2024-02-27 22:22:56] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Fetching gem metadata from https://rubygems.org/" [ERROR][2024-02-27 22:22:56] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "." [ERROR][2024-02-27 22:22:57] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "." [ERROR][2024-02-27 22:22:57] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "." [ERROR][2024-02-27 22:22:57] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "." [ERROR][2024-02-27 22:22:57] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "." [ERROR][2024-02-27 22:22:57] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "." [ERROR][2024-02-27 22:22:57] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "." [ERROR][2024-02-27 22:22:57] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "." [ERROR][2024-02-27 22:22:57] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "\n" [ERROR][2024-02-27 22:22:57] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using rake 13.0.6\n" [ERROR][2024-02-27 22:22:57] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using concurrent-ruby 1.2.2\n" [ERROR][2024-02-27 22:22:57] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using minitest 5.18.1\n" [ERROR][2024-02-27 22:22:57] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using zeitwerk 2.6.11\nUsing builder 3.2.4\n" [ERROR][2024-02-27 22:22:57] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using racc 1.7.1\n" [ERROR][2024-02-27 22:22:57] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using crass 1.0.6\n" [ERROR][2024-02-27 22:22:57] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using rack 2.2.8\n" [ERROR][2024-02-27 22:22:57] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using websocket-extensions 0.1.5\n" [ERROR][2024-02-27 22:22:57] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using marcel 1.0.2\n" [ERROR][2024-02-27 22:22:57] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using date 3.3.4\n" [ERROR][2024-02-27 22:22:57] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using timeout 0.4.1\n" [ERROR][2024-02-27 22:22:57] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using jsonapi-renderer 0.2.2\n" [ERROR][2024-02-27 22:22:57] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using ruby2_keywords 0.0.5\n" [ERROR][2024-02-27 22:22:57] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using formtastic_i18n 0.7.0\n" [ERROR][2024-02-27 22:22:57] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using method_source 1.0.0\n" [ERROR][2024-02-27 22:22:57] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using thor 1.2.2\n" [ERROR][2024-02-27 22:22:57] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using kaminari-core 1.2.2\n" [ERROR][2024-02-27 22:22:57] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using redis 4.6.0\n" [ERROR][2024-02-27 22:22:57] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using cgi 0.4.1\n" [ERROR][2024-02-27 22:22:57] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using multi_json 1.15.0\n" [ERROR][2024-02-27 22:22:57] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using public_suffix 4.0.7\n" [ERROR][2024-02-27 22:22:57] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using faraday-em_http 1.0.0\n" [ERROR][2024-02-27 22:22:57] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using faraday-em_synchrony 1.0.0\n" [ERROR][2024-02-27 22:22:57] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using faraday-excon 1.1.0\n" [ERROR][2024-02-27 22:22:57] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using faraday-httpclient 1.0.1\n" [ERROR][2024-02-27 22:22:57] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using multipart-post 2.2.3\n" [ERROR][2024-02-27 22:22:57] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using faraday-net_http_persistent 1.2.0\n" [ERROR][2024-02-27 22:22:57] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using faraday-patron 1.0.0\n" [ERROR][2024-02-27 22:22:57] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using faraday-rack 1.0.0\nUsing faraday-retry 1.0.3\nUsing connection_pool 2.2.5\nUsing ast 2.4.2\nUsing encryptor 3.0.0\nUsing erubi 1.12.0\nUsing nio4r 2.7.0\nUsing mini_mime 1.1.5\nUsing faraday-net_http 1.0.1\nUsing aws-eventstream 1.2.0\n" [ERROR][2024-02-27 22:22:57] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using jmespath 1.6.1\n" [ERROR][2024-02-27 22:22:57] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using statsd-ruby 1.5.0\n" [ERROR][2024-02-27 22:22:57] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using bcrypt 3.1.18\n" [ERROR][2024-02-27 22:22:57] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using bindex 0.8.1\n" [ERROR][2024-02-27 22:22:57] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using msgpack 1.5.2\n" [ERROR][2024-02-27 22:22:57] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using brakeman 5.2.3\n" [ERROR][2024-02-27 22:22:57] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using bundler 2.3.26\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using cancancan 3.3.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using matrix 0.4.2\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using regexp_parser 2.8.1\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using capybara-select-2 0.5.1\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using aws-partitions 1.598.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using coderay 1.1.3\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using byebug 11.1.3\nUsing courrier 1.0.1 from https://github.com/challengepost/courrier.git (at v1.0.1@c74217e)\nUsing chunky_png 1.4.0\nUsing rexml 3.2.6\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using rdoc 6.3.3\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using io-console 0.7.2\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using declarative 0.0.20\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using orm_adapter 0.5.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using rotp 6.2.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using diff-lcs 1.5.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using trailblazer-option 0.1.2\nUsing uber 0.1.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using dotenv 2.7.6\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using dry-cli 1.0.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using dry-inflector 0.2.1\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using e2mmap 0.1.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using elasticsearch-rails 7.2.1\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using ffi 1.15.5\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using mime-types-data 3.2022.0105\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using flipper 0.25.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using formatador 1.1.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using raabro 1.4.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using rchardet 1.8.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using rb-fsevent 0.11.1\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using elasticsearch-dsl 0.1.10\nUsing hashie 3.6.0\nUsing lumberjack 1.2.8\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using shellany 0.0.1\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using guard-compat 1.2.1\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using rspec-support 3.11.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using hashdiff 1.0.1\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using honeybadger 4.12.1\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using jwt 2.3.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using language_server-protocol 3.17.0.3\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using mixpanel-ruby 2.3.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using multi_xml 0.6.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using newrelic_rpm 7.2.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using parallel 1.22.1\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using pg 1.2.3\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using psych 3.3.4\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using rainbow 3.1.1\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using rqrcode_core 1.2.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using ruby-progressbar 1.11.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using unicode-display_width 2.1.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using nenv 0.3.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using rubyzip 2.3.2\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using tilt 2.0.10\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using websocket 1.2.10\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using state_machines 0.5.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using timecop 0.9.5\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using mini_magick 4.11.0\nUsing sorbet-runtime 0.5.11274\nUsing spring 4.0.0\nUsing i18n 1.13.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using tzinfo 2.0.6\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using nokogiri 1.15.4 (arm64-darwin)\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using rack-test 2.1.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using websocket-driver 0.7.6\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using net-protocol 0.2.2\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using redlock 1.2.2\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using addressable 2.8.4\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using faraday-multipart 1.0.4\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using warden 1.2.9\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using dry-core 0.7.1\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using elasticsearch-api 7.13.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using rack-protection 2.2.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using rack-proxy 0.7.6\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using sprockets 4.0.3\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using barnes 0.0.9\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using rack-mini-profiler 2.3.4\nUsing redis-objects 1.7.0\nUsing bootsnap 1.12.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using net-http-persistent 4.0.1\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using aws-sigv4 1.5.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using sidekiq 6.5.12\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using attr_encrypted 3.1.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using reline 0.4.3\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using pry 0.14.2\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using crack 0.4.5\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using mime-types 3.4.1\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using rb-inotify 0.10.1\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using ruby-vips 2.1.4\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using parser 3.1.2.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using sassc 2.4.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using thwait 0.2.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using representable 3.2.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using rspec-core 3.11.0\nUsing rspec-expectations 3.11.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using rqrcode 2.1.1\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using notiffany 0.1.3\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using selenium-webdriver 4.15.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using activesupport 6.1.7.6\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using loofah 2.20.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using net-imap 0.4.8\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using net-pop 0.1.2\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using net-smtp 0.4.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using faraday 1.10.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using xpath 3.2.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using rspec-mocks 3.11.1\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using et-orbi 1.2.7\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using faker 2.19.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using sanitize 6.0.2\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using customerio 4.3.0\nUsing dry-configurable 0.15.0\nUsing dry-logic 1.2.0\nUsing git 1.13.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using launchy 2.5.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using puma 5.6.8\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using vite_ruby 3.3.1\nUsing omniauth 2.1.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using aws-sdk-core 3.131.1\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using irb 1.11.2\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using webmock 3.18.1\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using rails-dom-testing 2.0.3\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using rails-html-sanitizer 1.5.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using globalid 1.1.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using activemodel 6.1.7.6\nUsing mail 2.8.1\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using arbre 1.7.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using airrecord 1.0.10\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using capybara 3.39.2\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using deprecation_toolkit 2.0.3\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using elasticsearch-transport 7.13.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using factory_bot 6.4.6\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using listen 3.7.1\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using inline_svg 1.9.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using oauth2 1.4.9\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using flipper-ui 0.25.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using fugit 1.5.3\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using image_processing 1.12.2\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using rubocop-ast 1.18.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using disposable 0.6.3\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using rspec 3.11.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using rspec-retry 0.6.2\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using rspec_junit_formatter 0.5.1\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using aws-sdk-kms 1.57.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using case_transform 0.2\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using actionview 6.1.7.6\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using debug 1.9.1\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using elasticsearch 7.13.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using guard 2.18.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using rufus-scheduler 3.8.1\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using aws-sdk-s3 1.114.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using reform 2.6.2\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using rubocop 1.30.1\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using omniauth-oauth2 1.7.2\nUsing actionpack 6.1.7.6\nUsing kaminari-actionview 1.2.2\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using jbuilder 2.11.5\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using guard-rspec 4.7.3\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using elasticsearch-model 7.2.1\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using sidekiq-scheduler 3.2.2\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using activejob 6.1.7.6\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using actioncable 6.1.7.6\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using activerecord 6.1.7.6\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using active_model_serializers 0.10.14\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using formtastic 5.0.0\nUsing has_scope 0.8.2\nUsing railties 6.1.7.6\nUsing date_validator 0.12.0\nUsing dry-container 0.9.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using file_validators 3.0.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using omniauth-rails_csrf_protection 1.0.1\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using sprockets-rails 3.4.2\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using rails-controller-testing 1.0.5\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using reform-rails 0.2.6\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using simple_form 5.1.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using state_machines-activemodel 0.8.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using actionmailer 6.1.7.6\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using activejob-uniqueness 0.2.5\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using activestorage 6.1.7.6\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using kaminari-activerecord 1.2.2\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using ransack 4.1.1\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using ancestry 4.1.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using acts-as-taggable-on 8.1.0\nUsing discard 1.2.1\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using flipper-active_record 0.25.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using responders 3.1.1\nUsing friendly_id 5.4.2\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using jquery-rails 4.6.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using activerecord-session_store 2.1.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using factory_bot_rails 6.4.3\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using dotenv-rails 2.7.6\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using js-routes 2.2.4\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using rspec-rails 5.1.2\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using web-console 4.2.1\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using vite_rails 3.0.14\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using sassc-rails 2.1.2\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using omniauth-auth0 3.0.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using dry-types 1.5.1\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using actionmailbox 6.1.7.6\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using actiontext 6.1.7.6\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using state_machines-activerecord 0.8.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using kaminari 1.2.2\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using sass-rails 6.0.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using devise 4.9.3\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using inherited_resources 1.14.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using devise-two-factor 4.1.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using activeadmin 3.2.0\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using rails 6.1.7.6\n" [ERROR][2024-02-27 22:22:58] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Installing prism 0.24.0 with native extensions\n" [ERROR][2024-02-27 22:23:02] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using ruby-lsp 0.14.3\n" [ERROR][2024-02-27 22:23:02] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Using ruby-lsp-rails 0.3.1\n" [ERROR][2024-02-27 22:23:02] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Bundle complete! 83 Gemfile dependencies, 255 gems now installed.\n" [ERROR][2024-02-27 22:23:02] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "Use `bundle info [gemname]` to see where a bundled gem is installed.\n" [ERROR][2024-02-27 22:23:02] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "1 installed gem you directly depend on is looking for funding.\n Run `bundle fund` for details\n" [ERROR][2024-02-27 22:23:03] .../vim/lsp/rpc.lua:734 "rpc" "/Users/alex/.local/share/nvim/mason/bin/ruby-lsp" "stderr" "/Users/alex/.rvm/rubies/ruby-3.1.4/lib/ruby/3.1.0/bundler/definition.rb:507:in `materialize': Could not find prism-0.24.0 in locally installed gems (Bundler::GemNotFound)\n\tfrom /Users/alex/.rvm/rubies/ruby-3.1.4/lib/ruby/3.1.0/bundler/definition.rb:187:in `specs'\n\tfrom /Users/alex/.rvm/rubies/ruby-3.1.4/lib/ruby/3.1.0/bundler/definition.rb:244:in `specs_for'\n\tfrom /Users/alex/.rvm/rubies/ruby-3.1.4/lib/ruby/3.1.0/bundler/runtime.rb:18:in `setup'\n\tfrom /Users/alex/.rvm/rubies/ruby-3.1.4/lib/ruby/3.1.0/bundler.rb:161:in `setup'\n\tfrom /Users/alex/.rvm/rubies/ruby-3.1.4/lib/ruby/3.1.0/bundler/setup.rb:20:in `block in '\n\tfrom /Users/alex/.rvm/rubies/ruby-3.1.4/lib/ruby/3.1.0/bundler/ui/shell.rb:136:in `with_level'\n\tfrom /Users/alex/.rvm/rubies/ruby-3.1.4/lib/ruby/3.1.0/bundler/ui/shell.rb:88:in `silence'\n\tfrom /Users/alex/.rvm/rubies/ruby-3.1.4/lib/ruby/3.1.0/bundler/setup.rb:20:in `'\n\tfrom :85:in `require'\n\tfrom :85:in `require'\n" ```

So, I added the cmd option to my lsp config:

use which ruby-lsp to get the path to the gem binary


local ruby_lsp = require('alex.utils.ruby-lsp')

lspconfig['ruby_ls'].setup({ capabilities = capabilities, cmd = { '/Users/alex/.rvm/gems/ruby-3.1.4@trello-teams/bin/ruby-lsp' }, on_attach = function(client, buffer) ruby_lsp.setup_diagnostics(client, buffer) ruby_lsp.add_ruby_deps_command(client, buffer) end, })

And now I got this, not sure whether or not I shoudl care about:
```javascript
[START][2024-02-27 22:45:56] LSP logging initiated
[ERROR][2024-02-27 22:45:56] .../vim/lsp/rpc.lua:734    "rpc"   "/Users/alex/.rvm/gems/ruby-3.1.4@trello-teams/bin/ruby-lsp"    "stderr"    "Ruby LSP> Skipping custom bundle setup since /Users/alex/Workspace/trello_teams/.ruby-lsp/Gemfile.lock already exists and is up to date\n"
[ERROR][2024-02-27 22:45:56] .../vim/lsp/rpc.lua:734    "rpc"   "/Users/alex/.rvm/gems/ruby-3.1.4@trello-teams/bin/ruby-lsp"    "stderr"    "Ruby LSP> Running bundle install for the custom bundle. This may take a while...\nRuby LSP> Command: (bundle check || bundle install) 1>&2\n"
[ERROR][2024-02-27 22:45:56] .../vim/lsp/rpc.lua:734    "rpc"   "/Users/alex/.rvm/gems/ruby-3.1.4@trello-teams/bin/ruby-lsp"    "stderr"    "The Gemfile's dependencies are satisfied\n"
[ERROR][2024-02-27 22:45:57] .../vim/lsp/rpc.lua:734    "rpc"   "/Users/alex/.rvm/gems/ruby-3.1.4@trello-teams/bin/ruby-lsp"    "stderr"    "Starting Ruby LSP v0.14.3...\n"
[ERROR][2024-02-27 22:45:57] .../vim/lsp/rpc.lua:734    "rpc"   "/Users/alex/.rvm/gems/ruby-3.1.4@trello-teams/bin/ruby-lsp"    "stderr"    "Ruby LSP Rails booting server\n"
[ERROR][2024-02-27 22:45:57] .../vim/lsp/rpc.lua:734    "rpc"   "/Users/alex/.rvm/gems/ruby-3.1.4@trello-teams/bin/ruby-lsp"    "stderr"    "Ruby LSP is ready\n"
[ERROR][2024-02-27 22:45:57] .../vim/lsp/rpc.lua:734    "rpc"   "/Users/alex/.rvm/gems/ruby-3.1.4@trello-teams/bin/ruby-lsp"    "stderr"    "The following cops were added to RuboCop, but are not configured. Please set Enabled to either `true` or `false` in your `.rubocop.yml` file.\n\nPlease also note that you can opt-in to new cops by default by adding this to your config:\n  AllCops:\n    NewCops: enable\nGemspec/DateAssignment: # new in 1.10\n  Enabled: true\nGemspec/DeprecatedAttributeAssignment: # new in 1.30\n  Enabled: true\nGemspec/RequireMFA: # new in 1.23\n"
[ERROR][2024-02-27 22:45:57] .../vim/lsp/rpc.lua:734    "rpc"   "/Users/alex/.rvm/gems/ruby-3.1.4@trello-teams/bin/ruby-lsp"    "stderr"    "  Enabled: true\nLayout/LineEndStringConcatenationIndentation: # new in 1.18\n  Enabled: true\nLayout/SpaceBeforeBrackets: # new in 1.7\n  Enabled: true\nLint/AmbiguousAssignment: # new in 1.7\n  Enabled: true\nLint/AmbiguousOperatorPrecedence: # new in 1.21\n  Enabled: true\nLint/AmbiguousRange: # new in 1.19\n  Enabled: true\nLint/DeprecatedConstants: # new in 1.8\n  Enabled: true\nLint/DuplicateBranch: # new in 1.3\n  Enabled: true\nLint/DuplicateRegexpCharacterClassElement: # new in 1.1\n  Enabled: true\nLint/EmptyBlock: # new in 1.1\n  Enabled: true\nLint/EmptyClass: # new in 1.3\n  Enabled: true\nLint/EmptyInPattern: # new in 1.16\n  Enabled: true\nLint/IncompatibleIoSelectWithFiberScheduler: # new in 1.21\n  Enabled: true\nLint/LambdaWithoutLiteralBlock: # new in 1.8\n  Enabled: true\nLint/NoReturnInBeginEndBlocks: # new in 1.2\n  Enabled: true\nLint/NumberedParameterAssignment: # new in 1.9\n  Enabled: true\nLint/OrAssignmentToConstant: # new in 1.9\n  Enabled: true\nLint/RedundantDirGlobSort: # new in 1.8\n  Enabled: true\nLint/RefinementImportMethods: # new in 1.27\n  Enabled: true\nLint/RequireRelativeSelfPath: # new in 1.22\n  Enabled: true\nLint/SymbolConversion: # new in 1.9\n  Enabled: true\nLint/ToEnumArguments: # new in 1.1\n  Enabled: true\nLint/TripleQuotes: # new in 1.9\n  Enabled: true\nLint/UnexpectedBlockArity: # new in 1.5\n  Enabled: true\nLint/UnmodifiedReduceAccumulator: # new in 1.1\n  Enabled: true\nLint/UselessRuby2Keywords: # new in 1.23\n  Enabled: true\nNaming/BlockForwarding: # new in 1.24\n  Enabled: true\nSecurity/CompoundHash: # new in 1.28\n  Enabled: true\nSecurity/IoMethods: # new in 1.22\n  Enabled: true\nStyle/ArgumentsForwarding: # new in 1.1\n  Enabled: true\nStyle/CollectionCompact: # new in 1.2\n  Enabled: true\nStyle/DocumentDynamicEvalDefinition: # new in 1.1\n  Enabled: true\nStyle/EndlessMethod: # new in 1.8\n  Enabled: true\nStyle/EnvHome: # new in 1.29\n  Enabled: true\nStyle/FetchEnvVar: # new in 1.28\n  Enabled: true\nStyle/FileRead: # new in 1.24\n  Enabled: true\nStyle/FileWrite: # new in 1.24\n  Enabled: true\nStyle/HashConversion: # new in 1.10\n  Enabled: true\nStyle/HashExcept: # new in 1.7\n  Enabled: true\nStyle/IfWithBooleanLiteralBranches: # new in 1.9\n  Enabled: true\nStyle/InPatternThen: # new in 1.16\n  Enabled: true\nStyle/MapCompactWithConditionalBlock: # new in 1.30\n  Enabled: true\nStyle/MapToHash: # new in 1.24\n"
[ERROR][2024-02-27 22:45:57] .../vim/lsp/rpc.lua:734    "rpc"   "/Users/alex/.rvm/gems/ruby-3.1.4@trello-teams/bin/ruby-lsp"    "stderr"    "  Enabled: true\nStyle/MultilineInPatternThen: # new in 1.16\n  Enabled: true\nStyle/NegatedIfElseCondition: # new in 1.2\n  Enabled: true\nStyle/NestedFileDirname: # new in 1.26\n  Enabled: true\nStyle/NilLambda: # new in 1.3\n  Enabled: true\nStyle/NumberedParameters: # new in 1.22\n  Enabled: true\nStyle/NumberedParametersLimit: # new in 1.22\n  Enabled: true\nStyle/ObjectThen: # new in 1.28\n  Enabled: true\nStyle/OpenStructUse: # new in 1.23\n  Enabled: true\nStyle/QuotedSymbols: # new in 1.16\n  Enabled: true\nStyle/RedundantArgument: # new in 1.4\n  Enabled: true\nStyle/RedundantInitialize: # new in 1.27\n  Enabled: true\nStyle/RedundantSelfAssignmentBranch: # new in 1.19\n  Enabled: true\nStyle/SelectByRegexp: # new in 1.22\n  Enabled: true\nStyle/StringChars: # new in 1.12\n  Enabled: true\nStyle/SwapValues: # new in 1.1\n  Enabled: true\nFor more information: https://docs.rubocop.org/rubocop/versioning.html\n"
[ERROR][2024-02-27 22:45:58] .../vim/lsp/rpc.lua:734    "rpc"   "/Users/alex/.rvm/gems/ruby-3.1.4@trello-teams/bin/ruby-lsp"    "stderr"    "Ruby LSP Rails failed to initialize server: Running via Spring preloader in process 29270\n/Users/alex/.rvm/gems/ruby-3.1.4@trello-teams/gems/bootsnap-1.12.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:15:in `require': cannot load such file -- sorbet-runtime (LoadError)\n\tfrom /Users/alex/.rvm/gems/ruby-3.1.4@trello-teams/gems/bootsnap-1.12.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:15:in `require'\n\tfrom /Users/alex/.rvm/gems/ruby-3.1.4@trello-teams/gems/zeitwerk-2.6.11/lib/zeitwerk/kernel.rb:38:in `require'\n\tfrom /Users/alex/.rvm/gems/ruby-3.1.4@trello-teams/gems/ruby-lsp-rails-0.3.1/lib/ruby_lsp/ruby_lsp_rails/server.rb:4:in `<main>'\n\tfrom /Users/alex/.rvm/gems/ruby-3.1.4@trello-teams/gems/bootsnap-1.12.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:39:in `load'\n\tfrom /Users/alex/.rvm/gems/ruby-3.1.4@trello-teams/gems/bootsnap-1.12.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:39:in `load'\n\tfrom /Users/alex/.rvm/gems/ruby-3.1.4@trello-teams/gems/railties-6.1.7.6/lib/rails/commands/runner/runner_command.rb:42:in `perform'\n\tfrom /Users/alex/.rvm/gems/ruby-3.1.4@trello-teams/gems/thor-1.2.2/lib/thor/command.rb:27:in `run'\n\tfrom /Users/alex/.rvm/gems/ruby-3.1.4@trello-teams/gems/thor-1.2.2/lib/thor/invocation.rb:127:in `invoke_command'\n\tfrom /Users/alex/.rvm/gems/ruby-3.1.4@trello-teams/gems/honeybadger-4.12.1/lib/honeybadger/plugins/thor.rb:17:in `invoke_command_with_honeybadger'\n\tfrom /Users/alex/.rvm/gems/ruby-3.1.4@trello-teams/gems/thor-1.2.2/lib/thor.rb:392:in `dispatch'\n\tfrom /Users/alex/.rvm/gems/ruby-3.1.4@trello-teams/gems/railties-6.1.7.6/lib/rails/command/base.rb:69:in `perform'\n\tfrom /Users/alex/.rvm/gems/ruby-3.1.4@trello-teams/gems/railties-6.1.7.6/lib/rails/command.rb:48:in `invoke'\n\tfrom /Users/alex/.rvm/gems/ruby-3.1.4@trello-teams/gems/railties-6.1.7.6/lib/rails/commands.rb:18:in `<main>'\n\tfrom /Users/alex/.rvm/gems/ruby-3.1.4@trello-teams/gems/bootsnap-1.12.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'\n\tfrom /Users/alex/.rvm/gems/ruby-3.1.4@trello-teams/gems/bootsnap-1.12.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'\n\tfrom /Users/alex/.rvm/gems/ruby-3.1.4@trello-teams/gems/zeitwerk-2.6.11/lib/zeitwerk/kernel.rb:38:in `require'\n\tfrom /Users/alex/Workspace/trello_teams/bin/rails:5:in `<main>'\n\tfrom /Users/alex/.rvm/gems/ruby-3.1.4@trello-teams/gems/bootsnap-1.12.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:39:in `load'\n\tfrom /Users/alex/.rvm/gems/ruby-3.1.4@trello-teams/gems/bootsnap-1.12.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:39:in `load'\n\tfrom /Users/alex/.rvm/gems/ruby-3.1.4@trello-teams/gems/activesupport-6.1.7.6/lib/active_support/fork_tracker.rb:10:in `block in fork'\n\tfrom /Users/alex/.rvm/gems/ruby-3.1.4@trello-teams/gems/activesupport-6.1.7.6/lib/active_support/fork_tracker.rb:10:in `block in fork'\n\tfrom /Users/alex/.rvm/gems/ruby-3.1.4@trello-teams/gems/activesupport-6.1.7.6/lib/active_support/fork_tracker.rb:8:in `fork'\n\tfrom /Users/alex/.rvm/gems/ruby-3.1.4@trello-teams/gems/activesupport-6.1.7.6/lib/active_support/fork_tracker.rb:8:in `fork'\n\tfrom /Users/alex/.rvm/gems/ruby-3.1.4@trello-teams/gems/activesupport-6.1.7.6/lib/active_support/fork_tracker.rb:27:in `fork'\n\tfrom /Users/alex/.rvm/gems/ruby-3.1.4@trello-teams/gems/activesupport-6.1.7.6/lib/active_support/fork_tracker.rb:8:in `fork'\n\tfrom /Users/alex/.rvm/gems/ruby-3.1.4@trello-teams/gems/activesupport-6.1.7.6/lib/active_support/fork_tracker.rb:27:in `fork'\n\tfrom <internal:/Users/alex/.rvm/rubies/ruby-3.1.4/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'\n\tfrom <internal:/Users/alex/.rvm/rubies/ruby-3.1.4/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'\n\tfrom -e:1:in `<main>'\n\n/Users/alex/.rvm/gems/ruby-3.1.4@trello-teams/gems/ruby-lsp-rails-0.3.1/lib/ruby_lsp/ruby_lsp_rails/runner_client.rb:56:in `rescue in initialize'\n/Users/alex/.rvm/gems/ruby-3.1.4@trello-teams/gems/ruby-lsp-rails-0.3.1/lib/ruby_lsp/ruby_lsp_rails/runner_client.rb:29:in `initialize'\n/Users/alex/.rvm/gems/ruby-3.1.4@trello-teams/gems/sorbet-runtime-0.5.11274/lib/types/private/methods/_methods.rb:279:in `bind_call'\n/Users/alex/.rvm/gems/ruby-3.1.4@trello-teams/gems/sorbet-runtime-0.5.11274/lib/types/private/methods/_methods.rb:279:in `block in _on_method_added'\n/Users/alex/.rvm/gems/ruby-3.1.4@trello-teams/gems/ruby-lsp-rails-0.3.1/lib/ruby_lsp/ruby_lsp_rails/runner_client.rb:15:in `new'\n/Users/alex/.rvm/gems/ruby-3.1.4@trello-teams/gems/ruby-lsp-rails-0.3.1/lib/ruby_lsp/ruby_lsp_rails/runner_client.rb:15:in `create_client'\n/Users/alex/.rvm/gems/ruby-3.1.4@trello-teams/gems/sorbet-runtime-0.5.11274/lib/types/private/methods/_methods.rb:279:in `bind_call'\n/Users/alex/.rvm/gems/ruby-3.1.4@trello-teams/gems/sorbet-runtime-0.5.11274/lib/types/private/methods/_methods.rb:279:in `block in _on_method_added'\n/Users/alex/.rvm/gems/ruby-3.1.4@trello-teams/gems/ruby-lsp-rails-0.3.1/lib/ruby_lsp/ruby_lsp_rails/addon.rb:29:in `block in activate'\n"
[ERROR][2024-02-27 22:45:58] .../vim/lsp/rpc.lua:734    "rpc"   "/Users/alex/.rvm/gems/ruby-3.1.4@trello-teams/bin/ruby-lsp"    "stderr"    "Server dependent features will not be available\n"

@vinistock I'm happy to contribute with some instructions for the Neovim editor setup but first I'd love to get this clarified to add as much context as possible to the guide.

vinistock commented 3 months ago

Context

The Ruby LSP integrates with Bundler to identify which dependencies your project uses. This allows the Ruby LSP to automatically connect to your formatter (like RuboCop) and to automatically detect which files have to be indexed for go to definition, hover, completion, etc - without requiring any configuration. To do this right, the Ruby LSP always has to run on the same Ruby version as your project. Otherwise, it may either fail to boot or fail to find gems.

For example, let's say your project uses Ruby 3.2.2, but you're trying to run the LSP with Ruby 3.3.0. The GEM_HOME for these two different Ruby versions are different. Depending on which version manager and operating system you're using, they might be something like this:

~/.gem/ruby/3.2.2/gems
~/.gem/ruby/3.3.0/gems

The Ruby LSP needs to know where gems are installed in the file system, so that we can read their files and index them. But to do that, we need the gems to be installed. AFAIK, there's no way to know where in the file system the require paths of a gem exist without having it installed, because gems can configure that in their gemspec files (example - we could simply add more directories to that configuration, which would need to be discovered and indexed).

So the LSP will first try to bundle install. If you're running the LSP with a Ruby version different than the one your project uses, then it will not find the gems installed. They are all installed in the 3.2.2 directory, but we're looking for them in the 3.3.0 directory.

Running bundle install here might fail. It's possible that a gem in your project's dependencies is locked to a version that doesn't support 3.3.0 yet, which would make running bundle install fail every time. This is why, in order to connect with the bundle and use Bundler's APIs, we need to be on the same Ruby version as your project.

How to set it up

This will probably depend on which version manager you are using (and I'm not a NeoVim user). My understanding is that you should configure the command to run the Ruby LSP as simply ruby-lsp.

When you cd into a project, if you version manager activates the environment automatically, it will set the right environment variables for you. Things like GEM_HOME, RUBY_VERSION and so on. When you open NeoVim on that directory, it will inherit the environment and then it should launch using the right Ruby version.

However, if NeoVim somehow allows you to switch projects without closing it, then indeed you'll have issues. When you switch to a different project, the previous environment activated by your version manager may no longer be valid.

I believe that's why some people reported that using the version manager shims works for them. Because those shims will go through the version manager first, to boot the ruby-lsp executable using the Ruby version configured in the project.

I think the possible solutions are:

Sorry for the wall of text, but I hope this is helpful context. Let me know if anything wasn't clear enough.

github-actions[bot] commented 1 month ago

This issue is being marked as stale because there was no activity in the last 2 months

dlegr250 commented 1 week ago

TL;DR

Details

I'm using Ruby 3.3.1 and recently switched to asdf as my version manager and am using the pre-release version of the ruby-lsp plugin in VS Code. It looks like this latest version includes a setting to select your Ruby version manager, and asdf is one of the options.

In addition, it looks like the ruby-lsp VS Code extension reads all the folders in the workspace and uses the first one it comes across. I recently switched from chruby and still had a .ruby-version in some of my other project folders which were in my VS Code workspace. If you read the ruby-lsp extension log output, it tells you exactly what it's doing, which is very helpful!

In my case, it was trying to load an older version of Ruby using the .ruby-version file in one of my other workspace folders. I just removed that folder from my workspace so that VS Code only had my "current" project directory to read from, and that seems to have solved it for me, I can now use the ruby-lsp extension in VS Code again.