You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I install the vscode extension, the Ruby LSP server crashes with the following information in the output tab:
2024-01-29 17:08:04.389 [info] (api) Trying to activate Ruby environment with command: /bin/bash -i -c 'asdf exec ruby -rjson -e "STDERR.printf(%{RUBY_ENV_ACTIVATE%sRUBY_ENV_ACTIVATE}, JSON.dump({ env: ENV.to_h, ruby_version: RUBY_VERSION, yjit: defined?(RubyVM::YJIT) }))"' inside directory: /home/user/project/api
2024-01-29 17:08:04.932 [info] (api) bundler: command not found: ruby-lsp
Install missing gem executables with `bundle install`
2024-01-29 17:08:04.943 [info] (api) [Error - 5:08:04 PM] Server initialization failed.
2024-01-29 17:08:04.943 [info] (api) Message: Pending response rejected since connection got disposed
Code: -32097
2024-01-29 17:08:04.943 [info] (api) [Info - 5:08:04 PM] Connection to server got closed. Server will restart.
2024-01-29 17:08:04.943 [info] (api) true
2024-01-29 17:08:04.943 [info] (api) [Error - 5:08:04 PM] Ruby LSP client: couldn't create connection to server.
2024-01-29 17:08:04.943 [info] (api) Message: Pending response rejected since connection got disposed
Code: -32097
2024-01-29 17:08:04.948 [info] (api) [Error - 5:08:04 PM] Server process exited with code 127.
2024-01-29 17:08:05.064 [info] (api) bundler: command not found: ruby-lsp
Install missing gem executables with `bundle install`
When I install the ruby-lsp gem globally to try to avoid the error (which I know is not how I'm supposed to be installing it), I then get the following errors when I launch vscode:
2024-01-29 17:14:45.287 [info] (api) Trying to activate Ruby environment with command: /bin/bash -i -c 'asdf exec ruby -rjson -e "STDERR.printf(%{RUBY_ENV_ACTIVATE%sRUBY_ENV_ACTIVATE}, JSON.dump({ env: ENV.to_h, ruby_version: RUBY_VERSION, yjit: defined?(RubyVM::YJIT) }))"' inside directory: /home/username/project/api
2024-01-29 17:14:45.805 [info] (api) bundler: failed to load command: ruby-lsp (/home/username/.asdf/installs/ruby/3.1.2/bin/ruby-lsp)
2024-01-29 17:14:45.805 [info] (api) /home/username/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.24/lib/bundler/rubygems_integration.rb:308:in `block in replace_bin_path': can't find executable ruby-lsp for gem ruby-lsp. ruby-lsp is not currently included in the bundle, perhaps you meant to add it to your Gemfile? (Gem::Exception)
from /home/username/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.24/lib/bundler/rubygems_integration.rb:336:in `block in replace_bin_path'
from /home/username/.asdf/installs/ruby/3.1.2/bin/ruby-lsp:25:in `<top (required)>'
from /home/username/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.24/lib/bundler/cli/exec.rb:58:in `load'
from /home/username/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.24/lib/bundler/cli/exec.rb:58:in `kernel_load'
from /home/username/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.24/lib/bundler/cli/exec.rb:23:in `run'
from /home/username/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.24/lib/bundler/cli.rb:486:in `exec'
from /home/username/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.24/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
from /home/username/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.24/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
from /home/username/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.24/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
from /home/username/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.24/lib/bundler/cli.rb:31:in `dispatch'
from /home/username/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.24/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
from /home/username/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.24/lib/bundler/cli.rb:25:in `start'
from /home/username/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.24/exe/bundle:48:in `block in <top (required)>'
from /home/username/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.24/lib/bundler/friendly_errors.rb:120:in `with_friendly_errors'
from /home/username/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.24/exe/bundle:36:in `<top (required)>'
from /home/username/.asdf/installs/ruby/3.1.2/bin/bundle:25:in `load'
from /home/username/.asdf/installs/ruby/3.1.2/bin/bundle:25:in `<main>'
2024-01-29 17:14:45.816 [info] (api) [Error - 5:14:45 PM] Server initialization failed.
2024-01-29 17:14:45.816 [info] (api) Message: Pending response rejected since connection got disposed
Code: -32097
2024-01-29 17:14:45.816 [info] (api) [Info - 5:14:45 PM] Connection to server got closed. Server will restart.
2024-01-29 17:14:45.816 [info] (api) true
2024-01-29 17:14:45.816 [info] (api) [Error - 5:14:45 PM] Ruby LSP client: couldn't create connection to server.
2024-01-29 17:14:45.816 [info] (api) Message: Pending response rejected since connection got disposed
Code: -32097
2024-01-29 17:14:45.825 [info] (api) [Error - 5:14:45 PM] Server process exited with code 1.
2024-01-29 17:14:46.004 [info] (api) bundler: failed to load command: ruby-lsp (/home/username/.asdf/installs/ruby/3.1.2/bin/ruby-lsp)
Finally, when I try to start the server by running ruby-lsp, I get the same "command not found" message if I have not installed the ruby-lsp gem globally, but once I install it globally myself, starting the server by running ruby-lsp works, just not in vscode.
The text was updated successfully, but these errors were encountered:
Thank you for the bug report! I'm not sure what the issue here is, but here are some suggestions to try out:
Is asdf up to date?
Can you try updating Bundler to the latest version? You can update the locked Bundler version with bundle update --bundler
If neither works, I suspect it could be related to VS Code permissions. The LSP might be failing to create the .ruby-lsp directory or failing to run bundle install on the custom bundle.
If you discover it is indeed a permission issue, please let us know which permission exactly you denied to VS Code. Full disk permission is definitely not needed (as I didn't grant that and can use the LSP just fine), so we've been unable to figure out exactly what causes the issue.
Asdf is up to date (v0.14.0), and after updating Bundler to the latest version (2.5.6), I'm still getting the same response as above. I'll look into the permissions and let you know if anything ends up working.
Operating System
Ubuntu 20.04.5 LTS (WSL2)
Ruby version
3.1.2
Project has a bundle
Ruby version manager being used
asdf
Description
When I install the vscode extension, the Ruby LSP server crashes with the following information in the output tab:
When I install the ruby-lsp gem globally to try to avoid the error (which I know is not how I'm supposed to be installing it), I then get the following errors when I launch vscode:
Finally, when I try to start the server by running ruby-lsp, I get the same "command not found" message if I have not installed the ruby-lsp gem globally, but once I install it globally myself, starting the server by running ruby-lsp works, just not in vscode.
The text was updated successfully, but these errors were encountered: