undefined method 'Pathname' for class RBS::EnvironmentLoader (NoMethodError) when running tests for version 3.10.4
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 2.2k
- Forks
- 256
- Avg merge
- 6d 17h
- Merged PRs (30d)
- 37
Description
When running tests for version 3.4.10 against ruby version 3.4.8 I get the following errors during the tests:
/build/ruby-rbs/src/rbs/lib/rbs/environment_loader.rb:26:in '<class:EnvironmentLoader>': undefined method 'Pathname' for class RBS::EnvironmentLoader (NoMethodError)
DEFAULT_CORE_ROOT = Pathname(_ = __dir__) + "../../core"
^^^^^^^^
from /build/ruby-rbs/src/rbs/lib/rbs/environment_loader.rb:4:in '<module:RBS>'
from /build/ruby-rbs/src/rbs/lib/rbs/environment_loader.rb:3:in '<top (required)>'
from <internal:/usr/lib/ruby/3.4.0/rubygems/core_ext/kernel_require.rb>:136:in 'Kernel#require'
from <internal:/usr/lib/ruby/3.4.0/rubygems/core_ext/kernel_require.rb>:136:in 'Kernel#require'
from /build/ruby-rbs/src/rbs/lib/rbs.rb:29:in '<top (required)>'
from <internal:/usr/lib/ruby/3.4.0/rubygems/core_ext/kernel_require.rb>:136:in 'Kernel#require'
from <internal:/usr/lib/ruby/3.4.0/rubygems/core_ext/kernel_require.rb>:136:in 'Kernel#require'
from /build/ruby-rbs/src/rbs/test/test_helper.rb:8:in '<top (required)>'
from <internal:/usr/lib/ruby/3.4.0/rubygems/core_ext/kernel_require.rb>:136:in 'Kernel#require'
from <internal:/usr/lib/ruby/3.4.0/rubygems/core_ext/kernel_require.rb>:136:in 'Kernel#require'
from /build/ruby-rbs/src/rbs/test/rbs/ancestor_builder_test.rb:1:in '<top (required)>'
from <internal:/usr/lib/ruby/3.4.0/rubygems/core_ext/kernel_require.rb>:136:in 'Kernel#require'
from <internal:/usr/lib/ruby/3.4.0/rubygems/core_ext/kernel_require.rb>:136:in 'Kernel#require'
from /usr/lib/ruby/gems/3.4.0/gems/rake-13.3.1/lib/rake/rake_test_loader.rb:21:in 'block in <main>'
from /usr/lib/ruby/gems/3.4.0/gems/rake-13.3.1/lib/rake/rake_test_loader.rb:6:in 'Array#select'
from /usr/lib/ruby/gems/3.4.0/gems/rake-13.3.1/lib/rake/rake_test_loader.rb:6:in '<main>'
rake aborted!
Command failed with status (1)
From my understanding the issue is a missing require 'pathname' in https://github.com/ruby/rbs/blob/v3.10.4/lib/rbs/environment_loader.rb before line 26.
I know this is an old version but as far as I can see this issue also wasn't fixed in the latest version and for no I'm stuck on the 3.x version branch.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with lib/rbs/environment_loader.rb around line 26 and reproduce the failure through the test setup referenced by test/test_helper.rb. Verify the environment loader can load on Ruby 3.4 and that the test suite proceeds without the Pathname NoMethodError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100