Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anything that involves accessing RbConfig fails with EXC BAD ACCESS #183

Open
lockieluke opened this issue Apr 12, 2024 · 1 comment
Open

Comments

@lockieluke
Copy link

Minimal reproducible:

use rutie::{Module, VM};

fn main() {
    VM::init();

    let rbconfig = Module::from_existing("RbConfig");
    println!("{:?}", rbconfig);

    VM::exit(0);
}

Logs:
image

Anything from require 'rbconfig' would fail with the same error, it did work at some point.

I have been using the macOS default Ruby from the very beginning and it does support SHARED

@lockieluke
Copy link
Author

Can confirm if you load rbconfig with its absolute path, it'll work:

VM::require("/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/universal-darwin23/rbconfig.rb");
let bin_dir = unsafe { Module::from_existing("RbConfig").const_get("CONFIG").send("[]", &[RString::from("bindir").into()]).try_convert_to::<RString>().unwrap().to_string() };
println!("{}", bin_dir);

Output:

/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant