-
Notifications
You must be signed in to change notification settings - Fork 172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ruby-lsp (0.20.1) fails to start due to not finding gem that is bundled in project (using rbenv 1.3.0) #2759
Comments
Thank you for the bug report! In your Ruby LSP settings, I noticed that you're setting the Also, do you happen to have any |
Weird — removing the project's PLATFORMS
aarch64-linux
- aarch64-linux-gnu
- aarch64-linux-musl
arm-linux
- arm-linux-gnu
- arm-linux-musl
arm64-darwin
x86-linux
- x86-linux-gnu
- x86-linux-musl
x86_64-darwin
x86_64-linux
- x86_64-linux-gnu
- x86_64-linux-musl The part that's extremely odd to me is, putting the old Gemfile.lock back makes no difference — ruby-lsp now runs without issue with either the older or the newer Gemfile.lock. |
Sure, though I don't think I explicitly changed that setting. Is it possible it got changed by the extension due to my testing opening
yes, in my eval "$(rbenv init - --no-rehash zsh)" |
The Ruby LSP uses a composed bundle that is auto managed to avoid having people need to add It's likely that the composed lockfile ( When you change the project's lockfile, the Ruby LSP re-generates the composed bundle from scratch to ensure that we're matching all dependencies properly, so that's probably what fixed it. I'll close the issue since the problem went away, but please let us know if you hit any issues again or if you uncover the root cause.
We don't mutate that setting and the default is an empty string. Not sure why it's showing
That should be fine, you're just sourcing the version manager. The reason I asked is because sometimes users have the expectation that setting environment variables in their shell scripts will somehow affect VS Code's extension host process, which is not the case. |
Seems to recur with any new empty rails app, tho, even outside / irrespective of VS Code: rm -rf .ruby-lsp
ruby-lsp
Ruby LSP> Running bundle install for the custom bundle. This may take a while...
Ruby LSP> Command: (bundle _2.5.21_ check || bundle _2.5.21_ install) 1>&2
Resolving dependencies...
The Gemfiles dependencies are satisfied
Could not find ruby-lsp-rails-0.3.21, sorbet-runtime-0.5.11611 in locally installed gems
Run `/Users/jm3/.rbenv/versions/3.3.2/lib/ruby/gems/3.3.0/gems/bundler-2.5.21/exe/bundle install` to install missing gems.
bundle
Bundle complete! 16 Gemfile dependencies, 98 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
cat .ruby-lsp/Gemfile
# This custom gemfile is automatically generated by the Ruby LSP.
# It should be automatically git ignored, but in any case: do not commit it to your repository.
eval_gemfile(File.expand_path("../Gemfile", __dir__))
gem "ruby-lsp", require: false, group: :development
gem "ruby-lsp-rails", require: false, group: :development% |
Do you have any RubyGems, Bundler or rbenv configurations? Including both shell scripts and files such as |
Description
Ruby LSP Information
✅ latest ruby lsp vs code extension (v0.8.8)
✅ latest ruby-lsp (0.20.1)
✅ latest VS Code (1.94.2)
See issue below after debug output (ruby-lsp refuses to start, complaining about the csv gem not being installed, even though the gem is bundled by the project's Gemfile)
VS Code Version
1.94.2
Ruby LSP Extension Version
0.8.8
Ruby LSP Server Version
Unknown
Ruby LSP Addons
Ruby Version
3.3.2
Ruby Version Manager
rbenv
Installed Extensions
Click to expand
Ruby LSP Settings
Click to expand
Workspace
User
Issue:
ruby-lsp refuses to start, complaining about the csv gem not being installed, even though the gem is bundled by the project's Gemfile
Project is a rails app, if that matters:
Click to expand Gemfile
???
Issue seems like it may be related to how rails (7.2.1) bundles — when I create a new test rails app, the same issue is reproducible: ruby-lsp fails to start, complaining about a missing (bundled) gem, in this case,
rubocop-rails-omakase
.The text was updated successfully, but these errors were encountered: