Luis Lavena wrote:
> On Oct 22, 9:35 am, "Philippe Lang" <philippe.l...@attiksystem.ch> > > wrote:
>> Hi,
>> I'd like to deploy an client ruby application by copying the
>> "c:\ruby" folder to the target computers.
>> It works fine, except that c:\ruby is 177 MB big, and full of things
>> that are not necessary at all on client computers.
>> I have tried keeping the following folders:
>> - "c:\ruby\."
>> - "c:\ruby\bin"
>> - "c:\ruby\lib"
>> It works, but I'd like to know if anyone has a more "scientific"
>> approach to that problem. What folders are absolutely needed?
>> Note that I know about rubyscript2exe.rb; it works just fine for
>> small applications, but it's not an option in this case.
>> Thanks!
>> Philippe
> Phillipe, most of the used space is wasted on documentation (in the
> form of yaml for RI and .html for Rdoc).
> Those are located in lib\ruby\gems\1.8\doc and the share\ri
> \1.8\system
> Also, try removing gems that you don't need for it.
> I know, isn't "scientific" nor bulletproof, but will work
Hi Luis,
This is the script I use. It strips down the c:\ruby directory from 179
MB to 51 MB on my computer, and apparently, everything works. It is
still very big, but acceptable, especially when compressed in RAR: 14.3
MB.
------------------------------------------------------------
$OLD_PATH = 'c:\\ruby'
$NEW_PATH = 'c:\\ruby_stripped'
require 'fileutils'
FileUtils.rm_rf($NEW_PATH)
FileUtils.mkdir($NEW_PATH)
FileUtils.cp_r($OLD_PATH + '\\bin', $NEW_PATH + '\\bin')
FileUtils.cp_r($OLD_PATH + '\\lib', $NEW_PATH + '\\lib')
FileUtils.rm_rf($NEW_PATH + '\\lib\\ruby\\gems\\1.8\\doc')
------------------------------------------------------------
If anyone is able to strip down the c:\ruby directory for deployment
even more, your help is welcome!