rake aborted! stack level too deep [duplicate]
Asked Answered
A

6

13

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)
Angers answered 11/8, 2010 at 7:43 Comment(1)
can you made same command with --trace argument ?Ratcliffe
C
21

try placing bundle exec in front of the rake command.

bundle exec rake -T
Chinn answered 16/8, 2011 at 19:31 Comment(6)
Not sure what the -T is for, but this worked for me. $bundle exec rake db:migrateSherry
-T just gives a list of all possible rake commands.Chinn
I'm new to Ruby on Rails, But i know that in my case bundler got installed as well... look at Bundler for more infoChinn
How do I fix it permanently? So I won't have to type bundle exec anymore..Fiberglass
fyi the full rake list from -T is: rake about rake assets:clean rake assets:precompile rake db:create rake db:drop rake db:fixtures:load rake db:migrate rake db:migrate:status rake db:rollback rake db:schema:dump rake db:schema:load rake db:seed rake db:setup rake db:structure:dump rake db:version rake doc:app rake log:clear rake middleware rake notes rake notes:custom rake rails:template rake rails:update rake routes rake secret rake stats rake test rake test:recent rake test:single rake test:uncommitted rake time:zones:all rake tmp:clear rake tmp:createNoreen
Tried bundle rake db:reset and I got this: Could not find command "rake".Savell
V
3

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

Vellicate answered 16/2, 2012 at 7:41 Comment(2)
true this was a bug and was fixed with github.com/rubygems/rubygems/commit/… - available in 1.8.16Tera
Tried that and got this: Latest version already installed. Done.Savell
D
2

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"

Depreciate answered 16/7, 2011 at 12:27 Comment(2)
I tried this solution, did't work for me. Do you know any other idea?Dusen
it did not worked because it's not related, this bug was fixed in rubygems 1.8.16Tera
Y
0

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).

Yolande answered 11/8, 2010 at 11:14 Comment(1)
I liked this, thanks! Unfortunately wasn't enough. I set: "ulimit -s unlimited" then checked "ulimit -a" and stack is unlimited. It still says the same "stack too deep" error. What be be the reason?Dusen
C
0

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.

Corporative answered 24/5, 2011 at 9:18 Comment(4)
As Rubygems 1.7.1 was released on April 1, 2011, and this question was asked on August 11, 2010, it may have been a different problem, even if the error messages were similar.Wadewadell
@Andrew yes, that's quite likely. However, since this solution took me a while to work out and solved my problem, I thought it would be a good idea to post it here, even at the risk of confusing people from 2010.Corporative
I am having this issue as well. It seems that version 1.8.10 is incompatible with rake 0.8.7.Frumpy
this bug was fixed in rubygems 1.8.16, just update to latest versionTera
S
0

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.

Slaw answered 21/12, 2011 at 22:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.