If a class inherits from BasicObject and then overwrites method_missing like this:

class A < BasicObject
def method_missing(*a)
puts "#{a}"
end
end

And we try it:

A.new.fooooo

The interpreter enters what looks like a loop and then crashes with this trace (in irb):

NoMemoryError: failed to allocate memory
from (irb):3:in method_missing'
from (irb):3:inmethod_missing'
from (irb):3:in method_missing'
from (irb):3:inmethod_missing'
from (irb):3:in method_missing'
from (irb):3:inmethod_missing'
from (irb):3:in method_missing'
from (irb):3:inmethod_missing'
from (irb):3:in method_missing'
from (irb):3:inmethod_missing'
from (irb):3:in method_missing'
from (irb):3:inmethod_missing'
from (irb):3:in method_missing'
from (irb):3:inmethod_missing'
from (irb):3:in method_missing'
from (irb):3:inmethod_missing'
from (irb):3:in method_missing'
from (irb):3:inmethod_missing'
from (irb):3:in method_missing'
from (irb):3:inmethod_missing'
from (irb):3:in method_missing'
from (irb):3:inmethod_missing'
from (irb):3:in method_missing'
from (irb):3:inmethod_missing'
from (irb):3:in method_missing'
from (irb):3:inmethod_missing'
from (irb):3:in method_missing'
from (irb):3:inmethod_missing'
from (irb):3:in method_missing'
from (irb):3:inmethod_missing'

If we create the same class with the same method_missing but without inheriting from BasicObject it works right.

"puts" is usually provided by Kernel#puts. But Kernel is not included in BasicObject.
You could solve this two ways:
* use "::Kernel::puts" instead of "puts" (the documentation about the first :: is being discussed in Bug #5067)
* include Kernel into your class A