Now I understand you.

It is indeed a typo in that example code and it should be "'" NOT ''' - the first two '' are taken as an empty string and the third one as a start of a new string - so it's not really a 'rem' - a # or =begin...=end does that in Ruby - it's simply made all of the following code into a string until it reaches the next ' which happens to be inside a comment "can't", thereafter the code resumes again, but of course at that point it's garbled and will return errors and not work...
This type of error is sometimes hard to find but if you are using Notepad++ it'd be obvious, as the syntax highlighting would should a massive block of 'string' text where it shouldn't be, so looking at it's start/end delimiters ['] tells us what's up and what needs fixing...
See the original and the correction [the rest of the code - with the exception of the unnecessary $ variable in the menu setup seems OK]
I thought you were using some of it for your own ends and having problems...
There are MANY errors in the API examples - it's been discussed, and indeed the main API docs used to have a user comments section at the end of each page where we pointed out the mistakes.
When Google moved the content these were 'lost'.
SketchUp still have the text but it's the way of including it that is lacking.
Various ways of introducing a 'wiki-like' system have been mooted, but nothing to date...