rutie
rutie copied to clipboard
Anything that involves accessing RbConfig fails with EXC BAD ACCESS
Minimal reproducible:
use rutie::{Module, VM};
fn main() {
VM::init();
let rbconfig = Module::from_existing("RbConfig");
println!("{:?}", rbconfig);
VM::exit(0);
}
Logs:
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
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