(1) Please go to the User Control Panel and fill in the statistics so we can better know about your level and use of SketchUp.
(2) Follow the Guide to learn standard Ruby basics, then simple SketchUp Ruby projects, before attempting advanced projects.
If you are attempting to program manifold solid features with or for the SketchUp Free edition, then you will need to be a very advanced programmer.
Look at the code that others have done in this area first. (It can save you a lot of time.)