Forum: Ruby How to correctly require my own DLL in ruby 1.9.1?

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.
4b5a792d75220b6be43ea298983d9c6e?d=identicon&s=25 David Lee (davidlee)
on 2009-03-27 08:57
I made a example.dll by using SWIG with Visual C++ Express 2008 Edition
base on the ruby 1.9.1 p0 binary downloaded from Ruby website.

However, when I run require 'example' in my ruby codes, it always
complain following messages.

C:\Documents and Settings\davidlee\My Documents\Visual Studio
2008\Projects\test\Release>ruby test1.rb
test1.rb:1:in `require': no such file to load -- example (LoadError)
        from test1.rb:1:in `<main>'

I am sure my example.dll was already under the current working
directory.
Who can help me on this issue?
Thanks.
F1d6cc2b735bfd82c8773172da2aeab9?d=identicon&s=25 Nobuyoshi Nakada (nobu)
on 2009-03-27 09:34
(Received via mailing list)
Hi,

At Fri, 27 Mar 2009 16:53:49 +0900,
David Lee wrote in [ruby-talk:332239]:
> C:\Documents and Settings\davidlee\My Documents\Visual Studio
> 2008\Projects\test\Release>ruby test1.rb
> test1.rb:1:in `require': no such file to load -- example (LoadError)
>         from test1.rb:1:in `<main>'
>
> I am sure my example.dll was already under the current working
> directory.

Rename it as example.so.  1.9 doesn't use .dll extension
anymore.
4b5a792d75220b6be43ea298983d9c6e?d=identicon&s=25 David Lee (davidlee)
on 2009-03-27 23:35
Nobuyoshi Nakada wrote:
> Hi,
>
> At Fri, 27 Mar 2009 16:53:49 +0900,
> David Lee wrote in [ruby-talk:332239]:
>> C:\Documents and Settings\davidlee\My Documents\Visual Studio
>> 2008\Projects\test\Release>ruby test1.rb
>> test1.rb:1:in `require': no such file to load -- example (LoadError)
>>         from test1.rb:1:in `<main>'
>>
>> I am sure my example.dll was already under the current working
>> directory.
>
> Rename it as example.so.  1.9 doesn't use .dll extension
> anymore.

It works just as you said.
Thanks a lot!
This topic is locked and can not be replied to.