Ruby gem dependency loading
<p>I'm putting some shared models for a rails app inside it's own gem. It's just models, so I'm not using an engine. Getting it set up seemed to work fine until I added the "acts_as_list" gem.</p>

<pre><code># gem - domain.gemspec
spec.add_dependency "acts_as_list"

# gem - lib/domain.rb
require "acts_as_list"

# gem - lib/domain/models/page.rb
acts_as_list scope: [:ancestry]
</code></pre>

<p>This works fine in the console for my gem, I can run methods specific to acts_as_list as usual. However, when I add my gem to another project, it gives me an error.</p>

<pre><code># project - Gemfile
gem "www_domain", path: "../www_domain"

Bundler::GemRequireError: There was an error while trying to load the gem 'domain'.
NoMethodError: undefined method `acts_as_list' for #&lt;Class:0x0055da70121ab0&gt;
/home/shaun/sites/demo/domain/lib/domain/models/page.rb:32:in `&lt;class:Page&gt;'
</code></pre>

<p>Is there something special I have to do in this case to access the <code>acts_as_list</code> method because my model is inside a gem?</p>

<p><strong>Update:</strong> Here is my complete <code>lib/domain.rb</code> file for the gem:</p>

<pre><code>require "yaml"
require "active_record"
require "acts_as_list"
require "ancestry"

# rbfiles = File.join(File.dirname(__FILE__), "lib", "**", "*.rb")
# Dir.glob(rbfiles).each do |file|
#   require file.gsub("lib/", "")
# end

module Domain
  # Your code goes here...
  def self.root
    File.dirname(__dir__)
  end

  def self.db_config
    YAML.load_file("#{Domain.root}/db/config.yml")["development"]
  end
end

require "domain/version"
require "domain/models/page"
require "domain/models/menu"
require "domain/models/article"
require "domain/models/page_part"
</code></pre>

<p>I can use <code>acts_as_list</code> and <code>ancestry</code> methods in the console of my gem (running <code>bin/console</code> from the gem directory). But the project console (running <code>bundle exec rails console</code> from the project directory) will not start because of the gem error I mentioned.</p>