Evaluating self in irb returns an object that prints as primary. Here is a transcript that should help:
$ irb >> self => main >> main NameError: undefined local variable or method `main' for main:Object from (irb):2 >> self.inspect => "main" >> self.class >> Object
When you enter main in irb, it tries to evaluate the variable main , which is not declared.
Ray toal
source share