Could not find matching row from RSPEC backtrace with rails 3.0.10

I upgraded to 3.0.10 due to a vulnerability in sql injection. After I updated, I ran the tests, and they all started throwing the above error along with the following lines.

Failure/Error: Unable to find matching line from backtrace SystemStackError: stack level too deep # /home/part/.rvm/gems/ruby-1.9.2-p0/gems/activerecord-3.0.10/lib/active_record/connection_adapters/abstract/database_statements.rb:153 
+4
source share
1 answer

I had a similar error when using Cucumber functions when upgrading my project from Rails 2.3.8 to 3.2.2 . I almost don't know that you can find out the stack trace of this error.

The real problem, in my case, was the double inclusion of a library called rest-client, once as a plugin and once as a gem. This was in my Gemfile as well as in my vendor / plugins directory. Perhaps you can quickly check if there is anything like this in your project.

I found this because of the tedious process of using "raise" in several places in my code. In your way of executing the rspec instruction that causes this error, put the invocation method calls in different places, for example.

 raise StandardError, 'code did reach here' 

This, with some logical search logic, will help you get closer to the criminal code. Once you are there, use the following construct to get the stack trace.

 begin # culprit code is here rescue Exception => e puts e.message puts e.backtrace.inspect end 

This worked for me, at least hope it helps you.

+1
source

All Articles