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
:
>> 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. 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.
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. Maybe it's just a bit on the small side.
http://dalibornasevic.com/posts/5-ruby-stack-level-too-deep-systemstackerror
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.