With a rails project that includes one gem hosted on a git repository, bundle fails:
Java::JavaLang::StackOverflowError: An error occurred while installing example (0.0.example), and Bundler cannot continue.
Removing that gem from the gemfile allows the bundle to complete successfully.