title: Including/Extending the Kernel doesn't add those methods on main:Object
body: <p>I'm trying to add a method into the <code>Kernel</code> module, but instead of reopening the <code>Kernel</code> and directly defining an instance method, I'm writing a module and I want <code>Kernel</code> to <code>extend/include</code> that module.</p>
  
  <pre><code>module Talk
    def hello
      puts "hello there"
    end
  end
  
  module Kernel
    extend Talk
  end
  </code></pre>
  
  <p>When I run this in IRB:</p>
  
  <pre><code>$ hello
  NameError: undefined local variable or method `hello' for main:Object
  from (irb):12
  from /Users/JackC/.rvm/rubies/ruby-1.9.2-p290/bin/irb:16:in `&lt;main&gt;
  </code></pre>
  
  <p>If I check the <code>instance_methods</code> on <code>Kernel</code>, I can see #hello was added to the <code>Kernel</code>, but not in <code>main Object</code>.</p>
  
  <p>I've also tried using <code>include</code>, but the same thing happens:</p>
  
  <pre><code>module Kernel
    include Talk
  end
  </code></pre>
  
  <p>However, if I define it directly:</p>
  
  <pre><code>module Kernel
    def hello
      puts "hello there"
    end
  end
  </code></pre>
  
  <p>Then it does get included in the <code>main Object</code>.</p>
  
  <pre><code>$ hello
  hello there
   =&gt; nil 
  </code></pre>
  
  <p>Including the <code>Talk</code> module in <code>Object</code> works too:</p>
  
  <pre><code>class Object
    include Talk
  end
  </code></pre>
  
  <p>Perhaps I'm doing this wrong, or I'm missing something simple, but this behavior is confusing me.</p>