From: Philippe Lang Date: 2007-10-24T16:51:35+09:00 Subject: Re: Stripping down One-Click Ruby Installer folder for deployment Jano Svitok wrote: > On 10/23/07, Philippe Lang wrote: >> 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! > > You may try (but not I am not sure if this will work, I *guess* it > will be regenerated on demand): > > FileUtils.rm_rf($NEW_PATH + '\\lib\\ruby\\gems\\1.8\\cache') > FileUtils.rm_rf($NEW_PATH + '\\lib\\ruby\\gems\\1.8\\source_cache') > > > If you don't plan on compiling extensions, you may remove *.lib > > Download spacemonger to see what are the largest files/dirs. > > You may strip more stuff, depending on what do you need - there's a > lot of stuff for TK for example, just make sure your stuff still runs > ;-) Hi Jano, Thanks, I was able to strip the ruby directory even further, with your help and the following script: ------------------------------------------ $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') FileUtils.rm_rf($NEW_PATH + '\\lib\\ruby\\gems\\1.8\\cache') FileUtils.rm_rf($NEW_PATH + '\\lib\\ruby\\gems\\1.8\\source_cache') FileUtils.rm_rf($NEW_PATH + '\\lib\\msvcrt-ruby18-static.lib') FileUtils.rm_rf($NEW_PATH + '\\lib\\msvcrt-ruby18.lib') FileUtils.rm_rf($NEW_PATH + '\\lib\\ruby\gems\1.8\gems\fxruby-1.6.12-mswin32\doc') FileUtils.rm_rf($NEW_PATH + '\\lib\\ruby\gems\1.8\gems\fxruby-1.6.12-mswin32\rdoc-sources') FileUtils.rm_rf($NEW_PATH + '\\lib\\ruby\gems\1.8\gems\fxruby-1.6.12-mswin32\examples') FileUtils.rm_rf($NEW_PATH + '\\lib\\ruby\gems\1.8\gems\fxruby-1.6.12-mswin32\tests') FileUtils.rm_rf($NEW_PATH + '\\lib\\ruby\gems\1.8\gems\rubyscript2exe-0.5.3') FileUtils.rm_rf($NEW_PATH + '\\lib\\ruby\gems\1.8\gems\hpricot-0.6-mswin32') ------------------------------------------ Deleting "cache" and "source_cache" did not harm the system, apparently. Now, compressed with 7-ZIP, the whole directry is 5.2MB big, which is more than acceptable for deployement. I still have to try "Exerb" when I have more time. Regards, Philippe