rake aborted! stack level too deep [duplicate]

[亡魂溺海] 提交于 2019-11-29 17:57:52

问题


Possible Duplicate:
Rails 3.0 & Ruby 1.9.2rc: Rake commands return 'already initialized constant' & stack level too deep errors. Any ideas

Am using Ruby version 1.9.1 on windows vista. Am getting the rake aborted error for any rake commands am using. This does not happen in all my app folder. Its happening only on a specific app folder.

C:\rails_project\stunetwork>rake db:reset
(in C:/rails_project/stunetwork)
rake aborted!
stack level too deep
C:/Ruby191/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2383:in `raw_load_rak
efile'
(See full trace by running task with --trace)

回答1:


try placing bundle exec in front of the rake command.

bundle exec rake -T



回答2:


You need to update your gem. I met this error with gem '1.8.10', and fixed by upgrading to 1.8.16

gem update --system




回答3:


I only had this problem with ruby-1.9.2-p180 via rvm.

Switching to ruby-1.9.2-p0 fixed the problem. try "rvm use 1.9.2-p0"




回答4:


The stack of the calls can depend on the gems you install (some gems monkeypatch the rails tasks) which explains why you would encounter this on a specific app and not on others.

On a unix system you could try using the ulimit command to increase your stack size. On the windows side I haven't found a solution yet.

Depending on which release of ruby you use on windows you may want to ask the maintainers how to increase the stack.

For ruby installer you will need to install the mingw compile environment, clone the github repository and recompile the ruby you use (not very sexy I admit).




回答5:


I just encountered this exact error message on Ubuntu, and was able to solve it by downgrading rubygems from 1.8.3 to 1.7.1.




回答6:


There is nice post by Yehuda Katz that explains why without bundle exec there can be version conflicts: http://yehudakatz.com/2011/05/30/gem-versioning-and-bundler-doing-it-right/

There is also bundle install --binstubs command that allows to version-safely run rake db:reset like this: bin/rake db:reset.



来源:https://stackoverflow.com/questions/3456304/rake-aborted-stack-level-too-deep

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!