iTranslated by AI
Troubleshooting Ruby Type Support Plugin Errors in VS Code
By installing the Steep plugin in VS Code, you will be able to display method signatures and enable completion:

However, while I was setting it up by referring to web pages, it didn't work correctly and displayed an error log like this:
Your RubyGems version (3.0.3.1) has a bug that prevents `required_ruby_version` from working for Bundler. Any scripts that use `gem install bundler` will break as soon as Bundler drops support for your Ruby version. Please upgrade RubyGems to avoid future breakage and silence this warning by running `gem update --system 3.2.3`
/Library/Ruby/Gems/2.6.0/gems/bundler-2.4.17/lib/bundler/definition.rb:540:in `materialize': Could not find steep-1.10.0, activesupport-8.0.2, concurrent-ruby-1.3.5, csv-3.3.3, fileutils-1.7.3, json-2.10.2, language_server-protocol-3.17.0.4, listen-3.9.0, logger-1.6.6, mutex_m-0.3.0, parser-3.3.7.2, rainbow-3.1.1, rbs-3.9.0, securerandom-0.4.1, strscan-3.1.2, terminal-table-4.0.0, uri-1.0.3, base64-0.2.0, benchmark-0.4.0, bigdecimal-3.1.9, connection_pool-2.5.0, drb-2.2.1, i18n-1.14.7, minitest-5.25.5, tzinfo-2.0.6, rb-fsevent-0.11.2, rb-inotify-0.11.1, ast-2.4.3, racc-1.8.1, unicode-display_width-3.1.4, ffi-1.17.1-arm64-darwin, unicode-emoji-4.0.4 in locally installed gems (Bundler::GemNotFound)
from /Library/Ruby/Gems/2.6.0/gems/bundler-2.4.17/lib/bundler/definition.rb:200:in `specs'
from /Library/Ruby/Gems/2.6.0/gems/bundler-2.4.17/lib/bundler/definition.rb:266:in `specs_for'
from /Library/Ruby/Gems/2.6.0/gems/bundler-2.4.17/lib/bundler/runtime.rb:18:in `setup'
from /Library/Ruby/Gems/2.6.0/gems/bundler-2.4.17/lib/bundler.rb:162:in `setup'
from /Library/Ruby/Gems/2.6.0/gems/bundler-2.4.17/lib/bundler/setup.rb:23:in `block in <top (required)>'
from /Library/Ruby/Gems/2.6.0/gems/bundler-2.4.17/lib/bundler/ui/shell.rb:159:in `with_level'
from /Library/Ruby/Gems/2.6.0/gems/bundler-2.4.17/lib/bundler/ui/shell.rb:111:in `silence'
from /Library/Ruby/Gems/2.6.0/gems/bundler-2.4.17/lib/bundler/setup.rb:23:in `<top (required)>'
from <internal:/Users/kitaitimakoto/.rubies/ruby-3.1.3/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from <internal:/Users/kitaitimakoto/.rubies/ruby-3.1.3/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
[Error - 15:32:32] Server process exited with code 1.
[Error - 15:32:32] Server initialization failed.
Message: Pending response rejected since connection got disposed
Code: -32097
[Info - 15:32:32] Connection to server got closed. Server will restart.
true
[Error - 15:32:32] Steep client: couldn't create connection to server.
Message: Pending response rejected since connection got disposed
Code: -32097
I usually use chruby with Zsh to use the latest Ruby or switch between versions, but it seems that the Ruby version pre-installed on the system is being used here...
I tried various things like creating a wrapper script to launch VS Code, but nothing worked. While looking through the issues for the Steep plugin, I found an issue titled Recognize RVM installed Rubies, which stated that the issue was resolved by launching with the code command. Although that was for RVM, it also successfully resolved the issue for chruby by launching with the code command (it also worked with the codium command for VSCodium).
Discussion