Rails upgrade to 4.2 Stack too deep error from arel

335 views Asked by At

I'm doing a rails upgrade and have been able to successfully get it to 4.1.16

Now to make the jump to 4.2... been able to successfully run bundle update but when I tried to run my specs, I'm getting a scanty SystemStackError as follow:

//home/vagrant/.rvm/gems/ruby-2.2.3/gems/arel-6.0.4/lib/arel/visitors/reduce.rb:14:in `rescue in visit': stack level too deep (SystemStackError)
from /home/vagrant/.rvm/gems/ruby-2.2.3/gems/arel-6.0.4/lib/arel/visitors/reduce.rb:13:in `visit'
from /home/vagrant/.rvm/gems/ruby-2.2.3/gems/arel-6.0.4/lib/arel/visitors/to_sql.rb:241:in `block in visit_Arel_Nodes_SelectCore'
from /home/vagrant/.rvm/gems/ruby-2.2.3/gems/arel-6.0.4/lib/arel/visitors/to_sql.rb:240:in `each'
from /home/vagrant/.rvm/gems/ruby-2.2.3/gems/arel-6.0.4/lib/arel/visitors/to_sql.rb:240:in `each_with_index'
from /home/vagrant/.rvm/gems/ruby-2.2.3/gems/arel-6.0.4/lib/arel/visitors/to_sql.rb:240:in `visit_Arel_Nodes_SelectCore'
from /home/vagrant/.rvm/gems/ruby-2.2.3/gems/arel-6.0.4/lib/arel/visitors/to_sql.rb:210:in `block in visit_Arel_Nodes_SelectStatement'
from /home/vagrant/.rvm/gems/ruby-2.2.3/gems/arel-6.0.4/lib/arel/visitors/to_sql.rb:209:in `each'
from /home/vagrant/.rvm/gems/ruby-2.2.3/gems/arel-6.0.4/lib/arel/visitors/to_sql.rb:209:in `inject'
 ... 9265 levels...
from /home/vagrant/.rvm/gems/ruby-2.2.3/bin/rspec:23:in `load'
from /home/vagrant/.rvm/gems/ruby-2.2.3/bin/rspec:23:in `<main>'
from /home/vagrant/.rvm/gems/ruby-2.2.3/bin/ruby_executable_hooks:15:in `eval'
from /home/vagrant/.rvm/gems/ruby-2.2.3/bin/ruby_executable_hooks:15:in `<main>'

I'm trying to figure out what's needed to be changed/updated here, thanks.

P.S: Ruby version is 2.2.3

#Update: I made a mistake in the previous stack-trace, was the wrong one, I've updated that now.

#Update ( 03/16 ): This seems to be caused by devise... I've managed to trace the error down to the following line in config/initializers/devise.rb:

require 'devise/orm/active_record'
1

There are 1 answers

0
x6iae On BEST ANSWER

I found it...

So, because I was trying to avoid this issue which also has a stackoverflow post here, it looks like I went too high with my devise version.

I was previously running devise 3.2.1, and I took it up to 3.5.1. I would have noticed this if I had only updated a single gem at a time...

However, version 3.4.1 works very well for me here now.

I should probably also mention that my pg gem version is 0.17.0.