Can be used to remove the compiled .rbo files if a gem does not
work well when compiled. If you find a gem that does not work when
compiled, it would be greatly appreciated if you reported it here or
to the MacRuby project itself so that someone can look into the
problem.

If you don't like the idea of calling compile each time you
install a gem, then you can use auto_compile to enable a
post-install hook that will automatically compile gems when they are
installed. You can call auto_compile a second time to turn off the
feature.

sudo macgem auto_compile # gems will compiled when you install them
sudo macgem auto_compile # gems will not be compiled when you install them

Caveats

Large gems will take a long time to compile, but these are the gems
that will benefit the most from being compiled so please be patient

This has only been tested on a few gems, but should not break
existing gems since we leave the original files around

At the moment, compiled gems will not provide usable backtraces

If you suspect a bug in the way MacRuby compiled a file, try running with pre-compiled files disabled like so: VM_DISABLE_RBO=1 macruby my_code.rb

.rbo files take up more disk space than their .rb equivalents

Known Issues

Source files using a non-standard suffix (e.g. mime-types has a .rb.data file) will not get compiled

This might be addressable in a later release, but is not a big deal

Gems that explicitly require a file with the file suffix (e.g. require 'nokogiri.rb') will never load the compiled version of the file

This issue may be addressed in MacRuby itself in the near future

Alternatively, those gems should be updated so that compiled code can be loaded

TODO

Parallel compilation to speed up compilation of large gems

This might require changes in the MacRuby compiler

Copyright

Copyright (c) 2011-2012 Mark Rada. See LICENSE.txt for further details.