title: Ruby: undefined method for not initialized
body: <blockquote>
    <p>Note: There are numerous answers explaining that you can get this error when you subclass <code>ActiveRecord::Base</code> and add an <code>#initialize</code> without <code>super</code>. No answer explains what is actually happening.</p>
  </blockquote>
  
  <p>I am working in someone else's code and I have an HTTParty service in a Rails app with the following class hierarchy. Note the subclass <code>#initialize</code> with a differing signature to the parent class.</p>
  
  <pre><code>module A
    class Base
      include HTTParty
      ...
    end
  end
  
  module A
    class User &lt; Base
  
      def initialize(user)
        @user = user
      end
    end
  end
  
  module A
    class PublicUser &lt; User
  
      def initialize(opts = {})
        @limit = opts[:limit]
        # no call to super
      end
    end
  end
  </code></pre>
  
  <p>Locally there are no problems with this, but in SemaphoreCI the following results:</p>
  
  <pre><code>A::PublicUser.new(limit: 1).some_method
  undefined method `some_method' for #&lt;A::PublicUser not initialized&gt;
  </code></pre>
  
  <p>I can't find any documentation about the "not initialized" message. What causes this sort of failure?</p>