ocran icon indicating copy to clipboard operation
ocran copied to clipboard

Error occurs during gemspec detection for local development gems

Open shinokaro opened this issue 9 months ago • 0 comments

Summary

When using Bundler in a development environment where a local gem is loaded via the gemspec directive in the Gemfile,
OCRAN raises an error during gemspec detection.

Specifically, OCRAN assumes that all loaded gems have a valid gemspec file located within the Ruby installation directory tree.
However, in the case of local development gems, even though spec.loaded_from is correctly set to the gemspec file,
the file resides outside of the standard installation tree, causing OCRAN to raise an error.

Example error message:

Gem spec [path] does not exist in the Ruby installation. Don't know where to put it.

Cause

  • Bundler correctly sets spec.loaded_from for local development gems.
  • However, OCRAN verifies that the gemspec file must exist within the Ruby installation directory,
    and treats anything outside as an error.
  • This mismatch between OCRAN's assumptions and the actual behavior in development environments leads to runtime errors.

Expected Behavior

Although no definitive policy has been decided at this time,
it is generally expected that local development gems should be handled gracefully and included in the package when appropriate.

Current Workaround

  • Avoid using the gemspec directive in the Gemfile during development.
  • Manually adjust $LOAD_PATH as needed in tools like bin/console.

References

  • This issue is not due to Ruby itself or Bundler specification changes.
  • Bundler correctly handles local development gems and sets proper paths for spec.loaded_from.

Notes

This issue is recorded for tracking purposes only.
No immediate fix is planned at this time.

shinokaro avatar Apr 29 '25 07:04 shinokaro