简体   繁体   English

设计堆栈级别太深错误

[英]Devise stack level too deep error

After install Devise I try to run 安装Devise后,我尝试运行

**rake db:migrate**

but it gives: 但它给出:

**rake aborted!
stack level too deep**

I'm on Ubuntu, changed 我在Ubuntu上,已更改

**ulimit -s unlimited**

and checked, it works, but still have the error. 并检查了它是否有效,但仍然有错误。

I use RVM , tried to work out with Ruby1.9.2-p180, Ruby-1.9.2-p0 , with Rails 3.0.9, Rails 3.1rc4, with Rubinius. 我使用RVM ,试图与Ruby1.9.2-p180,Ruby-1.9.2-p0Rails 3.0.9,Rails 3.1rc4和Rubinius一起工作。 Tried with SQLite3 and with PostgreSQL. 尝试使用SQLite3和PostgreSQL。 Tried to uncomment as many as I can from the migration file. 尝试从迁移文件中取消注释尽可能多的注释。

Read all related Stackoverflow posts (and realized what I have is actually named StackOverflow). 阅读所有相关的Stackoverflow帖子(并意识到我的名字实际上叫做StackOverflow)。

Any help would be highly appriaciated! 任何帮助将非常感激! Many thanks 非常感谢

您是否尝试过bundle exec rake db:migrate

stack level too deep errors typically result from infinite recursion problems. 堆栈级别过深的错误通常是由无限递归问题引起的。

New Answer: 新答案:

I forgot this was occurring during db:migrate. 我忘记了这是在db:migrate期间发生的。 Is something in your users table migration relying on something that would rely on it? 用户表迁移中的某些内容是否依赖于该迁移?

Old Answer: 旧答案:

It would be helpful for you to show the lines of code you have in your routes.rb file for devise. 显示您的route.rb文件中可供设计的代码行将对您有所帮助。 For example, you might have: 例如,您可能有:

devise_for :users, :controllers => { :registrations => "registration/foo" }

In this example, take a look at the new method in foo_controller.rb. 在此示例中,查看foo_controller.rb中的新方法。 If that method redirects to another controller that causes you to attempt to register again, you will have an infinite recursion. 如果该方法重定向到另一个控制器,导致您再次尝试注册,则将具有无限递归。

The first thing I would do is look at what controllers are being called by putting some sort of debug output in your controllers. 我要做的第一件事是通过在控制器中放置某种调试输出来查看正在调用的控制器。 Try: 尝试:

logger.debug("i am in foo")

or 要么

puts "i am in bar"

If you can provide more information, I may be able to help more. 如果您可以提供更多信息,我可能会提供更多帮助。

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

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