On Nov 10, 11:42   宮 
>
> > Well, the other approach you have is build ruby statically and use it
> > embedded and not depend of installed package version.
>
> Even though the shipped/statically linked solution works well for embedded
> Ruby, it doesn't solve the issues for the bindings code, where we *have* to
> query a Ruby installation for some paths, e.g. vendorarchdir/sitearchdir.
>
> Eric

On my previous experience dealing with embedding Ruby, I would
recommend you do not depend on system or user installed Ruby.

If you want your program be built and depend on that condition, expect
lot of problems due weirdness of each environment, compilers,
packaging rules, etc.

Other approach you could take is create a Ruby C Extension that acts
as bridge between your application and that installed Ruby. Distribute
it as gem and ask the user install it.

Provide a configuration to locate that compiled extension and connect
to the Ruby interpreter from it.

Then you don't care about the installed Ruby details as long you can
communicate with this bridge.

Something similar is done by Phusion Passenger (in general lines) but
expect lot of work due the above mentioned weirdness.

Other than that, would suggest you provide more details about your
'embedding' conditions directly to Ruby-Core for better answers.

--
Luis Lavena