Forum: Ruby Building Ruby without the Standard Library

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()?
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.