RMcNairn
RMcNairn

Reputation: 491

stack level too deep - when using Rake

When i try and preform a rake I get the following. I've tried a few fixed like imploding and reinstalling my rvm - ruby (v1.9.3-p125) but nothing seems to be working. Any ideas?

rake db:seed --trace
** Invoke db:seed (first_time)
** Execute db:seed
** Invoke db:abort_if_pending_migrations (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:abort_if_pending_migrations
rake aborted!
stack level too deep
/Users/rm/.rvm/gems/ruby-1.9.3-p125@global/gems/rake-0.9.2.2/lib/rake/task.rb:162
Tasks: TOP => db:seed

if I try and run a rake db:reset --trace

-- initialize_schema_migrations_table()
   -> 0.0025s
-- assume_migrated_upto_version(20120803181844,       ["/Users/rossmcnairn/rails/search/db/migrate"])
   -> 0.0218s
** Invoke db:structure:load_if_sql (first_time)
** Invoke db:create 
** Execute db:structure:load_if_sql
** Invoke db:seed (first_time)
** Execute db:seed
** Invoke db:abort_if_pending_migrations (first_time)
** Invoke environment 
** Execute db:abort_if_pending_migrations
rake aborted!
stack level too deep
/Users/rossmcnairn/.rvm/gems/ruby-1.9.3-p125@global/gems/rake-0.9.2.2/lib/rake/task.rb:162
Tasks: TOP => db:setup => db:seed

Ive checked that my bundle exec version and my regular rake versions match.

rake --version
rake, version 0.9.2.2

bundle exec rake --version
rake, version 0.9.2.2

Any help would be greatly appreciated!

Upvotes: 0

Views: 2170

Answers (3)

myfashionhub
myfashionhub

Reputation: 435

This may be obvious but it took me a few hours. I unwittingly created a class method for the model called create, which is the same as ActiveRecord create. So my seed file has circular reference.

I just kept staring at the seed file and wonder why I get the error while I was able to run it twice before (before adding the class method). Moral of the story: naming is important.

Upvotes: 0

mpapis
mpapis

Reputation: 53158

Updating OSX is known to give issues in rubies, you should recompile all your rubies:

chown -R $USER: $rvm_path
rvm get head
rvm reinstall 1.9.3-p125
rvm all-gesmsets do rvm gemset pristine

Also note that any other compiled stuff like libraries needs recompilation, this includes homebrew, macports, rvm pkg and any packages you have compiled manually.

Upvotes: 2

On Freund
On Freund

Reputation: 4436

** Execute db:abort_if_pending_migrations
rake aborted!

Did you try to run your migrations?

Upvotes: 0

Related Questions