Stripping down One-Click Ruby Installer folder for deployment

P

Philippe Lang

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
 
L

Luis Lavena

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 :)

HTH,

Luis
 
D

Daniel Berger

Luis said:
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 :)

I've asked for just a "core Ruby" distro in the past (i.e. no stdlib
even), but Matz was less than enthusiastic about it.

Regards,

Dan
 
P

Philippe Lang

Luis said:
=20
Phillipe, most of the used space is wasted on documentation (in the
form of yaml for RI and .html for Rdoc).=20
=20
Those are located in lib\ruby\gems\1.8\doc and the share\ri
\1.8\system=20
=20
Also, try removing gems that you don't need for it.
=20
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 =3D 'c:\\ruby'
$NEW_PATH =3D '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!

Regards,

Philippe
 
L

Luis Lavena

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')

Yeah, it's possible.

The thing is that Ruby (and One-Click) ship with a lot of things that
you rarely will use (or you aren't aware they are present).

Part of the idea for next releases of One-Click cover this topic, but
still no plan on how that will be achieved. One of things will be
Installer merge modules (MSM) to modularize the whole installer.

I'm collecting a few questions for a survey [1] to focus on what users
want/need for the next release. Please jump in to rubyinstaller-
(e-mail address removed) and provide feedback of what you will love it to
have (or better/more questions for the survey).

Regards,

[1] http://rubyforge.org/pipermail/rubyinstaller-devel/2007-October/000202.html

Luis
 
J

Jano Svitok

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')

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
;-)
 
L

Luis Lavena

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
;-)

The other, more complex, will involve use of something like Exerb [1]
to trace what files your application use.

(inside Exerb there is a tool called mkexy)

This will generate a .exy file containing which file and paths (and
extensions) are required by your application.

You just need to add later the ruby.exe, rubyw.exe (if you are
developing GUI applications) and of course msvcrt-libruby18.dll

Try to recreate the folder structure listed in the .exy and just put
there the files indicated.

Use this carefully, I haven't tested enough to confirm work in all
cases.

Regards,

Luis

[1] http://exerb.sourceforge.jp/index.en.html
 
P

Philippe Lang

Jano said:
=20
You may try (but not I am not sure if this will work, I *guess* it
will be regenerated on demand):=20
=20
FileUtils.rm_rf($NEW_PATH + '\\lib\\ruby\\gems\\1.8\\cache')
FileUtils.rm_rf($NEW_PATH + '\\lib\\ruby\\gems\\1.8\\source_cache')=20
=20
=20
If you don't plan on compiling extensions, you may remove *.lib
=20
Download spacemonger to see what are the largest files/dirs.
=20
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
;-)=20

Hi Jano,

Thanks, I was able to strip the ruby directory even further, with your
help and the following script:

------------------------------------------
$OLD_PATH =3D 'c:\\ruby'
$NEW_PATH =3D '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')=20
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top