“Stack level too deep” running rake db:create:all

后端 未结 4 544
被撕碎了的回忆
被撕碎了的回忆 2020-12-06 06:00

When I run rake db:create:all, I’m getting the following message:

/Users/junior/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/versio         


        
相关标签:
4条回答
  • 2020-12-06 06:35

    I found a hint on the internet how to avoid the error. See the link to "Rail 3.1 and Rake aborted". There is given no reason, but to use bundle exec rake instead of the pure rake call has done the trick there. Seems like the call for rake is calling itself recursively, without having noticed that the files are yet loaded.

    So give it a try and tell us if that worked for you.

    0 讨论(0)
  • 2020-12-06 06:35

    I've found another way to do not have to run bundle exec every time. For myself, working w/ Sinatra (not Rails), adding gem 'rake' to my Gemfile worked like a charm. :)

    0 讨论(0)
  • 2020-12-06 06:51

    If, like me, you are too lazy to use bundle every time:

    Want to see a magic trick? Try running gem uninstall rake. Confirm when asked about broken dependencies. Counter-intuitive, I know.

    Now run your rake command without bundle exec. Magic!

    I don't know how it really works, but I'm thinking it has something to do with your local/global gemsets; your rvm global rake should be the one being used now.

    No, this may not good practice, but like I said, it's for the lazy.

    0 讨论(0)
  • 2020-12-06 06:57

    Command gem uninstall rake showes me that I have multiple rake gems installed, after removing 2 out of 3 I don't need to use bundle exec any more!

    0 讨论(0)
提交回复
热议问题