Skip to content

Error occurs during gemspec detection for local development gems #34

@shinokaro

Description

@shinokaro

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions