Forum: Ruby Problems with "require" when embedding Ruby

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
74871b359f247ff724b64e5a505e87f7?d=identicon&s=25 Rurouni (Guest)
on 2006-03-06 16:59
I have Ruby interpreter embedded in engine... so far all was good. But
when I tried to require custom extension compiled in .dll(some C++
exported using SWIG) I encountered an error...  As far as I know require
simple is searching for .dll or .so with same name... Maybe SWIG
generates bad dll , but standart non embedded Ruby runs this require
very well....
Do you have any advices? Any help will be thanksfull.
Ee6ffca720cc428d70247dcd7377dd48?d=identicon&s=25 Kouhei Sutou (Guest)
on 2006-03-06 17:05
(Received via mailing list)
Hi,

In <3e557e01954a584ba2ce911037bbf55b@ruby-forum.com>
  "Problems with "require" when embedding Ruby" on Tue, 7 Mar 2006
00:59:24 +0900,
  Rurouni <rurouni.ghost@gmail.com> wrote:

> I have Ruby interpreter embedded in engine... so far all was good. But
> when I tried to require custom extension compiled in .dll(some C++
> exported using SWIG) I encountered an error...

Are you using rb_require()? If so, try the following:

  rb_funcall(Qnil, rb_intern("require"), 1, rb_str_new2("YOUR_LIB"));


Thanks,
This topic is locked and can not be replied to.