Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stack too deep: Error when running bundle exec rails c in app including draftsman #24

Closed
npafundi opened this issue May 20, 2015 · 5 comments

Comments

@npafundi
Copy link
Contributor

Hey @chrisdpeters, I'm not sure how to fix this one, and thought you could help.

My application includes the draftsman gem, and I'm running Bundler version 1.9.9. When I run bundle exec rails c in my application, I get the following error:

Bundler is using a binstub that was created for a different gem.
This is deprecated, in future versions you may need to `bundle binstub railties` to work around a system/bundle conflict.

However, this shows up thousands of times, until I eventually get a "stack too deep" error, and the rails console never launches:

<path to rbenv>/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/spec_set.rb:111:in `each': stack level too deep (SystemStackError)
    from <path to rbenv>/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/spec_set.rb:111:in `find'
    from <path to rbenv>/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/spec_set.rb:111:in `sorted'
    from <path to rbenv>/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/rubygems_integration.rb:315:in `find'
    from <path to rbenv>/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/rubygems_integration.rb:315:in `block in replace_bin_path'
    from <local path to draftsman>/draftsman/bin/rails:16:in `<top (required)>'
    from <local path to draftsman>/draftsman/bin/rails:16:in `load'
    from <local path to draftsman>/draftsman/bin/rails:16:in `<top (required)>'
    from <local path to draftsman>/draftsman/bin/rails:16:in `load'
     ... 10065 levels...
    from <local path to draftsman>/draftsman/bin/rails:16:in `load'
    from <local path to draftsman>/draftsman/bin/rails:16:in `<top (required)>'
    from <path to rbenv>/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/bin/rails:23:in `load'
    from <path to rbenv>/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/bin/rails:23:in `<main>'

I can run rails c locally just fine, but our staging and production environments require calling bundle exec, so they fail when trying to run. I'm a little out of my depth here, and not quite sure how these binstubs are used. This may fail for you too, on Bundler 1.9.9. Not sure if something changed in that release.

Thanks!

@npafundi
Copy link
Contributor Author

Tagging @glosie -- he's interested in this fix as well.

@chrisdpeters
Copy link
Collaborator

I think I should probably just remove the bin folder altogether. I took a look at some other gems' sources, and I have yet to see binstubs included with them.

@chrisdpeters
Copy link
Collaborator

@npafundi @glosie Can you give that a try and see if it alleviates the issue?

@npafundi
Copy link
Contributor Author

Thanks for the quick fix @chrisdpeters!
The recursive warnings are gone, and the rails console loads properly. I do still get the original warning, but only once:

Bundler is using a binstub that was created for a different gem.
This is deprecated, in future versions you may need to `bundle binstub draftsman` to work around a system/bundle conflict.

At this point, it's no big deal.

@chrisdpeters
Copy link
Collaborator

You're welcome, @npafundi!

Is it in a Rails app? Maybe look at the solution proposed here?
http://stackoverflow.com/a/23658355/175981

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants