Forum: Ruby Building Ruby without the Standard Library

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
6cd5090839b1021f85bd329e1ed09264?d=identicon&s=25 Andrew B. (andrew_b19)
on 2013-11-02 09:28
I have been writing an application (game library) which embeds Ruby into
C as a scripting language, and it has been working beautifully so far.
However, I realize that I may need to distribute this application to
Windows and OS X machines, which may be a problem for those without the
time or skill to install the latest Ruby version.

I am wondering if I can package a .dll or .so dynamic library of Ruby in
the same directory of the main executable without including most of the
Standard Library. I believe this would save about 10-20MB, but it would
also remove unneeded baggage such as webrick, openssl, and rubygems from
the scripting environment.

I am not sure whether I want to *build* ruby without the stdlib, or
simply cherry pick the libs from the build output. I am also unsure how
and when Ruby loads these libraries when embedded in a host C
environment. Possibly during the call to ruby_init_loadpath()?
This topic is locked and can not be replied to.