I’m building a large .NET project using Rake . We committed the Ruby environment to our source control and install gems to this “local” environment (like Albacore, Nokogiri, etc). We’re essentially following this guidance, using the RubyInstaller for Windows zip package.
trunk/
source/
packages/
ruby/ <-- ruby here!
build.bat <-- helper scripts (call Ruby/rake)
Solution.sln
However, our source control server is remotely hosted, on a virtual machine, and the link speed is slow. I’ve read that some people have trimmed down the Ruby environment, like in the Machine.Specifications project. But, that looks extreme! (is there even gem support there?)
I could just start deleting files and directories to see what works, but there must be some known set of files that can be removed and still support basic Ruby, Rake, and gems?
From my own experimentation and investigation, it’s kind of hard to determine what’s “required” and what’s optional. There are some files that appear very safe and easy to remove and others that I’d rather not play with. My results below only save about 5 MB… probably not enough to warrant doing this at all.
bin
The
ruby/bindirectory contains many batch scripts that are simply helpers to invoke therubyexecutable with the correct “applicaton”, like Rake or Gem. For example,rake.batcontains this lineYou can replace this with the right comamnd in your
build.batscript (assuming it’s “up” one level above the ruby environment, probably at the solution root)You could dump the rest of the batch scripts, but then you’ll have a little more trouble installing gems into the local environment.
And, as of Ruby 1.9.3, that’s only saving you 1.38KB. I’m sure some of those other non-extension files in this directory can be removed, but, without knowing what they do, it’s unsafe to proceed.
include (175 KB)
The
ruby/includedirectory appears to contain only C header files for developing against Ruby (I’m winging it here). I removed it and everything ran fine.lib/tcltk (4.7 MB)
The
ruby/lib/tcltklooks a lot like the include directory, but for Tcl programming.lib/ruby
The
ruby/lib/rubydirectory contains the gems for this installation and a whole lot more scary stuff. I’d stay out of this directory unless you want to inadvertently cripple your environment.share (27 KB)
The
ruby/sharedirectory appears to contain only help pages, dump ’em!