Loading extensions and embedding

R

Remi Gillig

Hello,

I'm trying to load the statically linked extensions. Ruby
(1.8.7) was compiled using the "--with-static-linked-ext" flag.

I made a little program that loads and runs a Ruby script.
Unfortunately, the extensions don't seem to work inside
my own code. However, they work with the normal Ruby
interpreter.

Here is the error I have with my program :
../test.rb:2: no such file to load -- socket
./lib/ping.rb:12
./test.rb:2:in `require'
./test.rb:2
My script is :
require 'ping'
print("Ping google.com : #{Ping.pingecho("google.com", 10, 80)}\n")

The initialisation of the Ruby environment is done like this :
ruby_init();
ruby_incpush(".");
ruby_incpush("lib");

Maybe there is a function to load the static extensions
but reading the code of the Ruby interpreter is not really
clear. Any idea? Thanks.

Remi Gillig.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top