ActiveRecord ACR Tables Allocation Aborted
The error is probably due to ActiveRecord AREL losing how to sum an empty array.
The corresponding line of code is in the alias_tracker.rb file:
count.sum
If count is an empty array, then the string is evaluated as:
[].sum
In Ruby, which does not work:
$ irb > [].sum NoMethodError: undefined method `sum' for []:Array
Rails ActiveSupport Variable # Amount
In Rails, which succeeds as ActiveSupport creates Enumerable # sum
$ irb > require 'active_support/core_ext/enumerable' > [].sum => 0
Your problem is probably due to the fact that some area of your application that is not related to your areas also creates the sum Enumerable # sum or Array #. Unbound code overwrites the Rails method.
This can happen in your code or in unrelated jewelry. The Rails gem is loaded earlier, usually first in the Gemfile, and any subsequent gem can interfere with Rails.
How to fix it?
Have you written a method called sum, possibly in a module named Enumerable or Array? If so, this is a good place to start. You can rename your method or try to change the method according to the Rails method, replacing the #sum code with this code:
module Enumerable def sum(identity = 0, &block) if block_given? map(&block).sum(identity) else inject(:+) || identity end end end
If you have not written a method called sum in your code, then the conflict will most likely be used in the gem that you are using. Try using the commenting stones you are using, then restart the application.
You can find a gem that defines a method called sum as follows:
$ cd /usr/lib/ruby/gems $ find | xargs grep "def sum\b"
Do you use any gems called sixarm? If so, contact me and I will fix them for you. It's me, and some of them define #sum for use with statistical tools and utilities.
Hope this helps. Can you post a message here if it solves your problem?