无法从回溯 RSPEC 与 Rails 3.0.10 中找到匹配行
由于sql注入漏洞,我已经更新到3.0.10。更新后,我运行了测试,所有测试都开始抛出上述错误以及以下几行。
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
I've updated to 3.0.10 because of the sql injection vulnerability. After I updated, I ran the tests and all of them 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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当我的项目从 Rails
2.3.8
升级到3.2.2
时,我在运行 Cucumber 功能时遇到了类似的错误。我几乎不可能知道您可以找到此错误的堆栈跟踪。就我而言,真正的问题是双重包含一个名为“rest-client”的库,一次作为插件,一次作为 gem。它位于我的 Gemfile 以及我的供应商/插件目录中。也许您可以快速检查一下您的项目是否存在类似的情况。
我通过在代码的几个地方使用“raise”的繁琐过程发现了这一点。在导致此错误的 rspec 语句的执行路径中,将 raise 方法调用放在不同的位置,例如
,使用一些二分搜索逻辑,将使您接近罪魁祸首代码。到达那里后,使用以下构造来获取堆栈跟踪。
这至少对我有用,希望对你有帮助。
I had experienced a similar error while running Cucumber features when upgrading my project from Rails
2.3.8
to3.2.2
. There's almost no way that I know you can find out the stack trace of this error.The real problem, in my case, was double inclusion of a library, called rest-client, once as a plugin, and once as a gem. It was in my Gemfile, as well as in my vendor/plugins directory. Maybe you can make a quick check if there's anything like that with your project.
I found this out by a tedious process of using 'raise' at several places of my code. In your execution path of the rspec statement that causes this error, put raise method calls at different places, e.g.
That, with some binary search logic, will get you close to the culprit code. Once you're there, use the following construct to get a stack trace.
That worked for me at least, hope it helps you.