ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: fiesta06 via ruby-core <ruby-core@ml.ruby-lang.org>
To: ruby-core@ml.ruby-lang.org
Cc: fiesta06 <fiesta06@gmx.de>
Subject: [ruby-core:117351] embedd ruby 3.3.0 - unknown Time.now class method
Date: Wed, 27 Mar 2024 22:22:48 +0100	[thread overview]
Message-ID: <9af76892-df94-4a51-8b25-7cc37215d5ac@gmx.de> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 548 bytes --]

Hi,

I want to embedd the ruby 3.3.0 interpreter into my application by using
the following code:

   int error, n;

   static char* args[] = {};

   n = 0;

   ruby_sysinit(&n, (char ***)&args);

   RUBY_INIT_STACK;

   ruby_init();

   ruby_init_loadpath();

   rb_eval_string_protect("p Time.now", &error);

   if(error) {

     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 ?

[-- Attachment #1.2: Type: text/html, Size: 1460 bytes --]

[-- Attachment #2: Type: text/plain, Size: 264 bytes --]

 ______________________________________________
 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/

                 reply	other threads:[~2024-03-27 21:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.ruby-lang.org/en/community/mailing-lists/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9af76892-df94-4a51-8b25-7cc37215d5ac@gmx.de \
    --to=ruby-core@ruby-lang.org \
    --cc=fiesta06@gmx.de \
    --cc=ruby-core@ml.ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).