Loading extensions and embedding


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

Here is the error I have with my program :
./test.rb:2: no such file to load – socket
./test.rb:2:in `require’
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 :

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.