Summary
Following the basic usage example in the README, Rubydex::Graph#index_workspace returns a FileError for the rails gem because the gem is a meta-gem and ships without a lib/ directory. RubyGems still resolves a default require path of lib for it, and Rubydex treats the missing directory as a hard error.
Reproduction
In a Rails 8 application's console:
graph = Rubydex::Graph.new
# => #<Rubydex::Graph:0x000000013fcad8f8 @workspace_path="/path/to/app">
graph.encoding = "utf16"
# => "utf16"
graph.index_workspace
# => ["FileError: Path `/path/to/app/.bundle/ruby/4.0.0/gems/rails-8.0.2.1/lib` does not exist"]
Expected behavior
index_workspace should successfully index the workspace and its dependencies. The rails meta-gem should be tolerated (skipped, or its missing lib/ ignored) rather than producing a FileError.
Root cause
The rails-8.0.2.1 gem installs only:
.../gems/rails-8.0.2.1/
├── MIT-LICENSE
└── README.md
The source rails.gemspec does not explicitly set require_paths. RubyGems falls back to its built-in default of ["lib"], defined in Gem::Specification's default-value table:
# rubygems/specification.rb
require_paths: ["lib"],
The setter's RDoc states the same:
The default value is "lib".
You can confirm this with no network access:
$ ruby -e 'require "rubygems"; p Gem::Specification.default_value(:require_paths)'
# => ["lib"]
$ ruby -e 'require "rubygems"; p Gem::Specification.new.require_paths'
# => ["lib"]
As a result, the RubyGems-generated stub spec at specifications/rails-8.0.2.1.gemspec writes the default back out:
s.require_paths = ["lib".freeze]
…even though no lib/ directory exists in the gem. Rubydex appears to iterate over each dependency's resolved require_paths and raise FileError when the directory is missing. Any meta-gem in this shape will hit this, and rails itself is almost always a direct dependency of Rails apps, so this is broadly reproducible.
Environment
- Rubydex:
0.2.3 (arm64-darwin)
- Ruby:
4.0.3
- Bundler:
4.x (custom BUNDLE_PATH pointing at a project-local .bundle/)
- Rails:
8.0.2.1
- OS: macOS (Darwin 25.5.0, Apple Silicon)
Summary
Following the basic usage example in the README,
Rubydex::Graph#index_workspacereturns aFileErrorfor therailsgem because the gem is a meta-gem and ships without alib/directory. RubyGems still resolves a default require path oflibfor it, and Rubydex treats the missing directory as a hard error.Reproduction
In a Rails 8 application's console:
Expected behavior
index_workspaceshould successfully index the workspace and its dependencies. Therailsmeta-gem should be tolerated (skipped, or its missinglib/ignored) rather than producing aFileError.Root cause
The
rails-8.0.2.1gem installs only:The source
rails.gemspecdoes not explicitly setrequire_paths. RubyGems falls back to its built-in default of["lib"], defined inGem::Specification's default-value table:The setter's RDoc states the same:
You can confirm this with no network access:
As a result, the RubyGems-generated stub spec at
specifications/rails-8.0.2.1.gemspecwrites the default back out:…even though no
lib/directory exists in the gem. Rubydex appears to iterate over each dependency's resolvedrequire_pathsand raiseFileErrorwhen the directory is missing. Any meta-gem in this shape will hit this, andrailsitself is almost always a direct dependency of Rails apps, so this is broadly reproducible.Environment
0.2.3(arm64-darwin)4.0.34.x(customBUNDLE_PATHpointing at a project-local.bundle/)8.0.2.1