fix: use require instead of require_relative for native extension#14
Merged
cpetersen merged 3 commits intoscientist-labs:mainfrom Mar 24, 2026
Merged
Conversation
Contributor
Author
|
@cpetersen thanks for fixing the related issue so fast: scientist-labs/red-candle#75 For this project I did not open an issue but made a PR. The situation is very similar. It seems that the PR so far got unnoticed. Can we try running the workflow? I tried to add tests similar to how you resolved the issue in the other project. But I won't promise that they pass. Sending this from my mobile / Hope it's okay that this is sort of a little reminder:) |
rb-sys 0.9.117 did not support Ruby 4.0's C API changes, causing "Failed to setup stable API" during native extension compilation. - Update magnus from 0.6 to 0.8 in Cargo.toml - Update rb-sys from 0.9.117 to 0.9.124 in Cargo.lock - Migrate all Rust source files from deprecated magnus 0.6 APIs to the new Ruby-handle-based 0.8 APIs (Ruby::get().unwrap() pattern) - Zero deprecation warnings Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The native extension was loaded with require_relative which forces Ruby to look inside the gem's lib/ directory. RubyGems installs compiled extensions into a separate extensions path and adds it to $LOAD_PATH. Using require resolves via $LOAD_PATH and finds the extension correctly.
65d39b8 to
b9b3216
Compare
Member
|
Thank you for your contribution! You're right, I did miss this one, thank you for the nudge. I just cut a new release (0.2.5) with your contribution! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The native extension was loaded with require_relative which forces Ruby to look inside the gem's lib/ directory. RubyGems installs compiled extensions into a separate extensions path and adds it to $LOAD_PATH. Using require resolves via $LOAD_PATH and finds the extension correctly.
See also:
scientist-labs/red-candle#75 / scientist-labs/red-candle@d4d881d