You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to use ruby inside a rust application, I'm having some issues with requiring gems with C extensions, in this case Nokogiri. When I VM::require("nokogiri"), I get an error from the VM: #<NameError: uninitialized constant RUBY_DESCRIPTION>.
To reproduce:
# Gemfile
# ...
gem "nokogiri"
// src/main.rs
use rutie::{VM, Object, NilClass};
fn main() {
VM::init();
VM::init_loadpath();
VM::require("rubygems");
if let Err(e) = VM::protect(|| {
VM::require("nokogiri");
NilClass::new().into()
}) {
let output = VM::error_info().unwrap();
eprintln!("{}", output);
}
}
voidInit_ruby_description(void)
{
VALUEdescription;
if (MJIT_OPTS_ON) {
description=MKSTR(description_with_jit);
}
else {
description=MKSTR(description);
}
/* * The full ruby version string, like <tt>ruby -v</tt> prints */rb_define_global_const("RUBY_DESCRIPTION", /* MKSTR(description) */description);
}
On many of these kinds of errors you can simply search the Ruby source code.
When trying to use ruby inside a rust application, I'm having some issues with requiring gems with C extensions, in this case Nokogiri. When I
VM::require("nokogiri")
, I get an error from the VM:#<NameError: uninitialized constant RUBY_DESCRIPTION>
.To reproduce:
I run the program with:
The text was updated successfully, but these errors were encountered: