The stack-trace and your code snippet does not match. There are no references (and should be no references) to #compileTree: or RBClass in the code you pasted into the mail.
The thing was to replace the line marked with [1] as I've commented above.
I don't get it, the code you posted looks ok. RBClass is a class private to the framework, you should never need to instantiate it directly. And if you do, only through an instance of RBNamespace that provides a delta to the current system state. In your example you don't need to do that.
The easiest is probably if you use the refactoring tools as integrated into OB. This does all automatically.
It should be too obvious but I didn't find how. May you comment how to perform the task in the script with OB?
1. Select "MyClass" 2. Menu "Refactoring Scope" -> "Class" 3. Menu "Rewrite Code" and fill the template 4. Accept the rewrite expression 5. Review and accept the proposed changes This is also show here in a slightly older version of OB: http://www.lukas-renggli.ch/blog/ob-rb-3 Lukas -- Lukas Renggli www.lukas-renggli.ch