This error appears when you have unstable keys and tries to sort them. Example:
[{'foo'=>99,'bar'=>1},{'foo'=>0,'bar'=>2, 'qwe' => 7}] a.sort_by{|v| v['qwe']} ArgumentError: comparison of NilClass with 7 failed
Try to do
a.sort_by{|v| [v['qwe']].select{|k| not k.nil?}}
But this does not work for me in
[v['index'],v['count'],v['digit'],v['value']]
where the figure is unstable
user3713526 Jul 01 '15 at 11:06 2015-07-01 11:06
source share