添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
发财的枕头  ·  使用Netsuite ...·  4 小时前    · 
讲道义的闹钟  ·  rake aborted! ...·  1 月前    · 
欢快的匕首  ·  Undefined method ...·  1 月前    · 
聪明伶俐的脆皮肠  ·  CocoaPods ...·  3 月前    · 
玩手机的帽子  ·  Solved: CubeMX + ...·  3 月前    · 
讲道义的脸盆  ·  樱花智能锁荣获 ...·  1 月前    · 
紧张的电梯  ·  Trying to understand ...·  9 月前    · 

Undefined method "dependencies" for nil:NilClass when trying to run ruby-lsp or ruby-lsp-doctor
#1149

Closed

Description

Ruby version

3.2.2

Code snippet

just running the command generates the error for me.

ruby-lsp

$ ruby-lsp
Ruby LSP> Skipping custom bundle setup since /Users/developer/code/social_crowd/deploy/socialcrowd-api/.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 Gemfile's dependencies are satisfied
bundler: failed to load command: ruby-lsp (/Users/developer/.rbenv/versions/3.2.2/bin/ruby-lsp)
/Users/developer/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/ruby-lsp-0.12.1/lib/ruby_indexer/lib/ruby_indexer/configuration.rb:201:in `block in initial_excluded_gems': undefined method `dependencies' for nil:NilClass (NoMethodError)
        dependency.to_spec.dependencies.each do |transitive_dependency|
                          ^^^^^^^^^^^^^
  from /Users/developer/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/ruby-lsp-0.12.1/lib/ruby_indexer/lib/ruby_indexer/configuration.rb:198:in `each'
  from /Users/developer/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/ruby-lsp-0.12.1/lib/ruby_indexer/lib/ruby_indexer/configuration.rb:198:in `initial_excluded_gems'
  from /Users/developer/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/sorbet-runtime-0.5.11104/lib/types/private/methods/_methods.rb:277:in `bind_call'
  from /Users/developer/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/sorbet-runtime-0.5.11104/lib/types/private/methods/_methods.rb:277:in `block in _on_method_added'
  from /Users/developer/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/ruby-lsp-0.12.1/lib/ruby_indexer/lib/ruby_indexer/configuration.rb:21:in `initialize'
  from /Users/developer/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/sorbet-runtime-0.5.11104/lib/types/private/methods/_methods.rb:277:in `bind_call'
  from /Users/developer/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/sorbet-runtime-0.5.11104/lib/types/private/methods/_methods.rb:277:in `block in _on_method_added'
  from /Users/developer/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/ruby-lsp-0.12.1/lib/ruby_indexer/ruby_indexer.rb:15:in `new'
  from /Users/developer/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/ruby-lsp-0.12.1/lib/ruby_indexer/ruby_indexer.rb:15:in `<module:RubyIndexer>'
  from /Users/developer/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/ruby-lsp-0.12.1/lib/ruby_indexer/ruby_indexer.rb:14:in `<top (required)>'
  from <internal:/Users/developer/.rbenv/versions/3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
  from <internal:/Users/developer/.rbenv/versions/3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
  from /Users/developer/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/ruby-lsp-0.12.1/lib/ruby_lsp/internal.rb:19:in `<top (required)>'
  from <internal:/Users/developer/.rbenv/versions/3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
  from <internal:/Users/developer/.rbenv/versions/3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
  from /Users/developer/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/ruby-lsp-0.12.1/exe/ruby-lsp:89:in `<top (required)>'
  from /Users/developer/.rbenv/versions/3.2.2/bin/ruby-lsp:25:in `load'
  from /Users/developer/.rbenv/versions/3.2.2/bin/ruby-lsp:25:in `<top (required)>'
  from /Users/developer/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.12/lib/bundler/cli/exec.rb:58:in `load'
  from /Users/developer/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.12/lib/bundler/cli/exec.rb:58:in `kernel_load'
  from /Users/developer/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.12/lib/bundler/cli/exec.rb:23:in `run'
  from /Users/developer/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.12/lib/bundler/cli.rb:492:in `exec'
  from /Users/developer/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.12/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
  from /Users/developer/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.12/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
  from /Users/developer/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.12/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
  from /Users/developer/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.12/lib/bundler/cli.rb:34:in `dispatch'
  from /Users/developer/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.12/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
  from /Users/developer/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.12/lib/bundler/cli.rb:28:in `start'
  from /Users/developer/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.12/exe/bundle:45:in `block in <top (required)>'
  from /Users/developer/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.12/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
  from /Users/developer/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.12/exe/bundle:33:in `<top (required)>'
  from /Users/developer/.rbenv/versions/3.2.2/bin/bundle:25:in `load'
  from /Users/developer/.rbenv/versions/3.2.2/bin/bundle:25:in `<main>'

ruby-lsp-doctor

$ ruby-lsp-doctor
/Users/developer/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/ruby-lsp-0.12.1/lib/ruby_indexer/lib/ruby_indexer/configuration.rb:201:in `block in initial_excluded_gems': undefined method `dependencies' for nil:NilClass (NoMethodError)
        dependency.to_spec.dependencies.each do |transitive_dependency|
                          ^^^^^^^^^^^^^
  from /Users/developer/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/ruby-lsp-0.12.1/lib/ruby_indexer/lib/ruby_indexer/configuration.rb:198:in `each'
  from /Users/developer/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/ruby-lsp-0.12.1/lib/ruby_indexer/lib/ruby_indexer/configuration.rb:198:in `initial_excluded_gems'
  from /Users/developer/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/sorbet-runtime-0.5.11104/lib/types/private/methods/call_validation.rb:256:in `bind_call'
  from /Users/developer/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/sorbet-runtime-0.5.11104/lib/types/private/methods/call_validation.rb:256:in `validate_call'
  from /Users/developer/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/sorbet-runtime-0.5.11104/lib/types/private/methods/_methods.rb:275:in `block in _on_method_added'
  from /Users/developer/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/ruby-lsp-0.12.1/lib/ruby_indexer/lib/ruby_indexer/configuration.rb:21:in `initialize'
  from /Users/developer/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/sorbet-runtime-0.5.11104/lib/types/private/methods/call_validation.rb:256:in `bind_call'
  from /Users/developer/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/sorbet-runtime-0.5.11104/lib/types/private/methods/call_validation.rb:256:in `validate_call'
  from /Users/developer/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/sorbet-runtime-0.5.11104/lib/types/private/methods/_methods.rb:275:in `block in _on_method_added'
  from /Users/developer/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/ruby-lsp-0.12.1/lib/ruby_indexer/ruby_indexer.rb:15:in `new'
  from /Users/developer/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/ruby-lsp-0.12.1/lib/ruby_indexer/ruby_indexer.rb:15:in `<module:RubyIndexer>'
  from /Users/developer/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/ruby-lsp-0.12.1/lib/ruby_indexer/ruby_indexer.rb:14:in `<top (required)>'
  from <internal:/Users/developer/.rbenv/versions/3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
  from <internal:/Users/developer/.rbenv/versions/3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
  from /Users/developer/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/ruby-lsp-0.12.1/lib/ruby_lsp/internal.rb:19:in `<top (required)>'
  from <internal:/Users/developer/.rbenv/versions/3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
  from <internal:/Users/developer/.rbenv/versions/3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
  from /Users/developer/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/ruby-lsp-0.12.1/exe/ruby-lsp-doctor:5:in `<top (required)>'
  from /Users/developer/.rbenv/versions/3.2.2/bin/ruby-lsp-doctor:25:in `load'
  from /Users/developer/.rbenv/versions/3.2.2/bin/ruby-lsp-doctor:25:in `<main>'

Description

I'm using VSC and have installed the ruby-lsp plugin (following the instructions and not installing it in my system).

It works fine for a project using 3.1.3 ruby but for my main project using 3.2.2 I'm getting errors trying to run it.

I'm using VSC Insiders (for latest copilot) and rbenv for managing ruby versions.

I tried uninstalling and re-installing 3.2.2 to get a clean run of everything and it's giving the same errors.

This is in a rails 7 project.

I've tried to just run from the command line directly and I get the same errors which I've included at the top.

Expected output

It should startup the server without having issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

Labels

bug Something isn't working Something isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions