[ruby-core:117351] embedd ruby 3.3.0 - unknown Time.now class method
From:
fiesta06 via ruby-core <ruby-core@...>
Date:
2024-03-27 21:22:48 UTC
List:
ruby-core #117351
Hi,
I want to embedd the ruby 3.3.0 interpreter into my application by using
the following code:
=C2=A0 int error, n;
=C2=A0 static char* args[] =3D {};
=C2=A0 n =3D 0;
=C2=A0 ruby_sysinit(&n, (char ***)&args);
=C2=A0 RUBY_INIT_STACK;
=C2=A0 ruby_init();
=C2=A0 ruby_init_loadpath();
=C2=A0 rb_eval_string_protect("p Time.now", &error);
=C2=A0 if(error) {
=C2=A0=C2=A0=C2=A0 rb_eval_string("p :ERROR");
}
In principle it does work. However, the Time class is missing the now
method, thus a :ERROR is printed.
What it missing in the above code ?
______________________________________________
ruby-core mailing list -- ruby-core@ml.ruby-lang.org
To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/