简体   繁体   English

Ruby on Rails堆栈级别太深

[英]Ruby on rails stack level too deep

Consider following model: 考虑以下模型:

class Category < ActiveRecord::Base
    # nothing in the model
end

>> rails c

>> Category.all     # works fine

But when I do as below, it throws the error stack level too deep : 但是当我按以下方式进行操作时,它会将错误stack level too deep抛出的stack level too deep

>> Category.order("updated_at DESC") # you should assume syntax is right

I am having this error after upgrading ruby to 1.9.3 from 1.8.7 and rails to 3.2.0 from 3.0.4. 将ruby从1.8.7升级到1.9.3并将rails从3.0.4升级到3.2.0后出现此错误。 It was working fine before I upgraded. 在升级之前,它工作正常。 There was no code change at all, only versions are upgraded. 根本没有代码更改,仅升级了版本。

However I have another project on my machine with old versions and I'm facing no error there. 但是,我的计算机上还有一个旧版本的项目,并且在那里我没有遇到任何错误。

Apparently it looks like problem is because of upgraded versions but not sure, I have read many threads on stackoverflow but did not get satisfactory answer. 显然问题似乎是由于升级版本引起的,但不确定,我在stackoverflow上阅读了很多线程,但没有得到满意的答案。

Please help I have already spent considerable time on fixing this issue with no success. 请帮助我已经花费了相当多的时间来解决此问题,但没有成功。

Try to increase the stack size with the ulimit command. 尝试使用ulimit命令增加堆栈大小。 Maybe it's just a bit on the small side. 也许这只是一个小方面。

http://dalibornasevic.com/posts/5-ruby-stack-level-too-deep-systemstackerror http://dalibornasevic.com/posts/5-ruby-stack-level-too-deep-systemstackerror

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM