Unable to run bundler's specs

I'm trying to get a development environment set up for Bundler. I'm going through docs/development/SETUP.md.
I can successfully run bin/rake spec:deps, but then running bin/rake spec says it can't require rake. Any ideas what's up here?

Terminal logs
~/dev/ruby/bundler/bundler$ bin/rake spec:deps
/usr/bin/ruby -S gem install --no-document --conservative 'automatiek:~> 0.1.0' 'rake:~> 12.0' 'ronn:~> 0.7.3' 'rspec:~
> 3.6' 'rubocop:= 0.65.0'
spec:deps ran for   0.000219   0.000035   0.225902 (  0.234842)
~/dev/ruby/bundler/bundler$ bin/rake spec
bin/rspec

An error occurred while loading ./spec/bundler/gem_helper_spec.rb.
Failure/Error: require "rake"

LoadError:
  cannot load such file -- rake
# ./spec/bundler/gem_helper_spec.rb:3:in `<top (required)>'
Run options: exclude {:ruby_repo=>false, :bundler=>#<RequirementChecker:./spec/support/requirement_checker.rb:7>, :ruby
gems_master=>true, :rubygems=>#<RequirementChecker:./spec/support/requirement_checker.rb:7>, :ruby=>#<RequirementChecke
r:./spec/support/requirement_checker.rb:7>, :realworld=>true, :sudo=>true}

Retried examples: 0

Finished in 0.00357 seconds (files took 0.76781 seconds to load)
0 examples, 0 failures, 1 error occurred outside of examples

rake aborted!
Command failed with status (1): [bin/rspec...]
/home/pup/dev/ruby/bundler/bundler/Rakefile:32:in `block in <top (required)>'
/home/pup/dev/ruby/bundler/bundler/Rakefile:23:in `block in invoke'
/home/pup/dev/ruby/bundler/bundler/Rakefile:22:in `invoke'
/home/pup/.gem/ruby/2.5.0/gems/rake-12.3.2/exe/rake:27:in `<top (required)>'
Tasks: TOP => spec
(See full trace by running task with --trace)
~/dev/ruby/bundler/bundler$

If I run RUBYOPT=-rrake then it'll start running the specs, but I get a ton of failures -- including tests that failed because they couldn't include rake. (I'm guessing there's subprocesses being spawned?)

Can you rm -rf tmp/gems and try again?

I'm also having a similar problem with rake. Running this command bin/rake spec is not successful on my end, I keep getting rake aborted
rake aborted!
Command failed with status (1): [bin/rspec...]
/home/prosper-opara/.rvm/rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/file_utils.rb:67:in `block in create_shell_runner'
/home/prosper-opara/.rvm/rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/file_utils.rb:57:in `sh'
/home/prosper-opara/Desktop/bundler/Rakefile:32:in `block in <top (required)>'
/home/prosper-opara/.rvm/rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:273:in `block in execute'
/home/prosper-opara/.rvm/rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:273:in `each'
/home/prosper-opara/.rvm/rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:273:in `execute'
/home/prosper-opara/.rvm/rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:214:in `block in invoke_with_call_chain'
/home/prosper-opara/.rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/monitor.rb:230:in `mon_synchronize'
/home/prosper-opara/.rvm/rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:194:in `invoke_with_call_chain'
/home/prosper-opara/.rvm/rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:183:in `invoke'
/home/prosper-opara/Desktop/bundler/Rakefile:23:in `block in invoke'
/home/prosper-opara/.rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/benchmark.rb:293:in `measure'
/home/prosper-opara/Desktop/bundler/Rakefile:22:in `invoke'
/home/prosper-opara/.rvm/rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:160:in `invoke_task'
/home/prosper-opara/.rvm/rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/home/prosper-opara/.rvm/rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:116:in `each'
/home/prosper-opara/.rvm/rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:116:in `block in top_level'
/home/prosper-opara/.rvm/rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:125:in `run_with_threads'
/home/prosper-opara/.rvm/rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:110:in `top_level'
/home/prosper-opara/.rvm/rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:83:in `block in run'
/home/prosper-opara/.rvm/rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:186:in `standard_exception_handling'
/home/prosper-opara/.rvm/rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:80:in `run'
/home/prosper-opara/.rvm/rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/exe/rake:27:in `<top (required)>'
bin/rake:17:in `load'
bin/rake:17:in `<main>'
Tasks: TOP => spec

I don't know what could be going on... I tried both on my system and on a fresh rvm docker image, and it works... Are you using latest master? Do you have both rake and rspec installed (you should get a proper message if not, but I'm out of ideas)?

@deivid-rodriguez  yes, forked and cloned bundler last night (WAT), I guess i cloned the latest master

@deivid-rodriguez I'm sorry for making you pass through the stress.
I tried again with a better internet connection and it looks like it was successful, though i got some pending (expected failures) and one Failure
Pending: (Failures listed here are expected and do not affect your suite's status)

  1) Bundler::Source#version_message when there are locked gems that contain the relevant gem spec with a different version with color should return a string with the spec name and version and locked spec version
     # tty color is not supported with Thor::Shell::Basic environment.
     # ./spec/bundler/source_spec.rb:62

  2) Bundler::Source#version_message when there are locked gems that contain the relevant gem spec with a more recent version with color should return a string with the locked spec version in yellow
     # tty color is not supported with Thor::Shell::Basic environment.
     # ./spec/bundler/source_spec.rb:85

  3) Bundler::Source#version_message when there are locked gems that contain the relevant gem spec with an older version with color should return a string with the locked spec version in green
     # tty color is not supported with Thor::Shell::Basic environment.
     # ./spec/bundler/source_spec.rb:102

  4) bundle exec `load`ing a ruby file instead of `exec`ing regarding $0 and __FILE__ when the path is relative with a leading ./ relative paths with ./ have absolute __FILE__
     # Not yet implemented
     # ./spec/commands/exec_spec.rb:776

Failures:

  1) bundle update git sources with submodules unlocks the source when submodules are removed from git source
     Failure/Error: expect(out).to eq("GEM")

       expected: "GEM"
            got: "GIT"

       (compared using ==)

       Commands:
       $ /home/prosper-opara/.rvm/rubies/ruby-2.6.0/bin/ruby -rrubygems -S gem --backtrace generate_index
       Generating Marshal quick index gemspecs for 2 gems
       ..
       Complete
       Generated Marshal quick index gemspecs: 0.001s
       Generating specs index
       Generated specs index: 0.000s
       Generating latest specs index
       Generated latest specs index: 0.000s
       Generating prerelease specs index
       Generated prerelease specs index: 0.000s
       Compressing indices
       Compressed indices: 0.000s
       # $? => 0

       $ git submodule add /home/prosper-opara/Desktop/os/bundler/tmp/libs/submodule-1.0 submodule-1.0
       Cloning into 'submodule-1.0'...
       done.
       # $? => 0

       $ /home/prosper-opara/.rvm/rubies/ruby-2.6.0/bin/ruby \
         -I/home/prosper-opara/Desktop/os/bundler/lib:/home/prosper-opara/Desktop/os/bundler/spec \
         -rsupport/hax -r/home/prosper-opara/Desktop/os/bundler/spec/support/artifice/fail \
         /home/prosper-opara/Desktop/os/bundler/exe/bundle install --retry 0
       Fetching /home/prosper-opara/Desktop/os/bundler/tmp/libs/has_submodule-1.0
       Fetching source index from file:///home/prosper-opara/Desktop/os/bundler/tmp/gems/remote4/
       Resolving dependencies...
       Using bundler 2.1.0.pre.1
       Using submodule 1.0 from /home/prosper-opara/Desktop/os/bundler/tmp/libs/has_submodule-1.0 (at master@25c6447)
       Using has_submodule 1.0 from /home/prosper-opara/Desktop/os/bundler/tmp/libs/has_submodule-1.0 (at master@25c6447)
       Bundle complete! 1 Gemfile dependency, 3 gems now installed.
       Use `bundle info [gemname]` to see where a bundled gem is installed.
       Cloning into 'submodule-1.0'...
       done.
       # $? => 0

       $ /home/prosper-opara/.rvm/rubies/ruby-2.6.0/bin/ruby -I/home/prosper-opara/Desktop/os/bundler/lib \
         -e  \
         <<EOS
         require 'bundler' ; Bundler.setup()
         require 'submodule'
       EOS
       GIT
       # $? => 0

       $ /home/prosper-opara/.rvm/rubies/ruby-2.6.0/bin/ruby \
         -I/home/prosper-opara/Desktop/os/bundler/lib:/home/prosper-opara/Desktop/os/bundler/spec \
         -rsupport/hax -r/home/prosper-opara/Desktop/os/bundler/spec/support/artifice/fail \
         /home/prosper-opara/Desktop/os/bundler/exe/bundle install --retry 0
       Fetching /home/prosper-opara/Desktop/os/bundler/tmp/libs/has_submodule-1.0
       Fetching source index from file:///home/prosper-opara/Desktop/os/bundler/tmp/gems/remote4/
       Resolving dependencies...
       Using bundler 2.1.0.pre.1
       Using submodule 1.0 from /home/prosper-opara/Desktop/os/bundler/tmp/libs/has_submodule-1.0 (at master@25c6447)
       Using has_submodule 1.0 from /home/prosper-opara/Desktop/os/bundler/tmp/libs/has_submodule-1.0 (at master@25c6447)
       Bundle complete! 1 Gemfile dependency, 3 gems now installed.
       Use `bundle info [gemname]` to see where a bundled gem is installed.
       # $? => 0

       $ /home/prosper-opara/.rvm/rubies/ruby-2.6.0/bin/ruby -I/home/prosper-opara/Desktop/os/bundler/lib \
         -e  \
         <<EOS
         require 'bundler' ; Bundler.setup()
         require 'submodule'
       EOS
       GIT
       # $? => 0
     # ./spec/update/git_spec.rb:181:in `block (4 levels) in <top (required)>'
     # ./spec/spec_helper.rb:97:in `block (2 levels) in <top (required)>'

Finished in 31 minutes 22 seconds (files took 25.44 seconds to load)
2705 examples, 1 failure, 4 pending

Failed examples:

rspec ./spec/update/git_spec.rb:162 # bundle update git sources with submodules unlocks the source when submodules are removed from git source

rake aborted!
Command failed with status (1): [bin/rspec...]
/home/prosper-opara/Desktop/os/bundler/Rakefile:32:in `block in <top (required)>'
/home/prosper-opara/Desktop/os/bundler/Rakefile:23:in `block in invoke'
/home/prosper-opara/Desktop/os/bundler/Rakefile:22:in `invoke'
Tasks: TOP => spec
(See full trace by running task with --trace)

No problem, thanks for keeping trying :smiley:.
What git version are you using? Is it lower than 2.9.0? I think the failure might be related to that.

I upgraded my git version to 2.21 and test passed :).
How did you know it might be a git version glitch? I'm really curious

See https://github.com/bundler/bundler/pull/7174 :smiley:.
Something I don't understand is why tests started working for you after changing your internet connection. Our specs should not touch the network I think (except for installing dependencies).

Yah, i think it was for downloading some gem dependency that were not pre-installed.

@duckinator Did you manage to get back on track here? If not, I can try to help.

Hey, sorry for disappearing!
@deivid-rodriguez I just tried again and get a New And Exciting Error™ from bin/rake spec:
/usr/bin/ruby -S gem install 'rack:< 2.0' 'rack-test:~> 1.1' 'artifice:~> 0.6.0' 'compact_index:~> 0.11.0' 'sinatra:~> 1.4.7' 'rake:12.3.2' 'builder:~> 3.2' ruby-graphviz --no-document --conservative
ERROR:  While executing gem ... (NameError)
    uninitialized constant Gem::RDoc

If I copy/paste that command it works, so it seems specific to how bin/rake is running gem.

Full logs
~/dev/ruby/bundler/bundler$ bin/rake spec
bin/rspec
Run options: exclude {:non_windows=>false, :ruby_repo=>false, :bundler=>#<RequirementChecker:./spec/support/requirement
_checker.rb:7>, :rubygems_master=>true, :git=>#<RequirementChecker:./spec/support/requirement_checker.rb:7>, :rubygems=
>#<RequirementChecker:./spec/support/requirement_checker.rb:7>, :ruby=>#<RequirementChecker:./spec/support/requirement_
checker.rb:7>, :realworld=>true, :sudo=>true}

Randomized with seed 21075
installing gems for the tests to use...
/usr/bin/ruby -S gem install 'rack:< 2.0' 'rack-test:~> 1.1' 'artifice:~> 0.6.0' 'compact_index:~> 0.11.0' 'sinatra:~>
1.4.7' 'rake:12.3.2' 'builder:~> 3.2' ruby-graphviz --no-document --conservative
ERROR:  While executing gem ... (NameError)
    uninitialized constant Gem::RDoc

An error occurred in a `before(:suite)` hook.
Failure/Error: system(cmd) || raise("Installing gems #{deps} for the tests to use failed!")

RuntimeError:
  Installing gems 'rack:< 2.0' 'rack-test:~> 1.1' 'artifice:~> 0.6.0' 'compact_index:~> 0.11.0' 'sinatra:~> 1.4.7' 'rak
e:12.3.2' 'builder:~> 3.2' ruby-graphviz for the tests to use failed!
# ./spec/support/rubygems_ext.rb:57:in `install_gems'
# ./spec/support/rubygems_ext.rb:39:in `setup'
# ./spec/spec_helper.rb:102:in `block (2 levels) in <top (required)>'

Retried examples: 0

Finished in 0.18115 seconds (files took 0.77902 seconds to load)
0 examples, 0 failures, 1 error occurred outside of examples

Randomized with seed 21075

rake aborted!
Command failed with status (1): [bin/rspec...]
/home/pup/dev/ruby/bundler/bundler/Rakefile:32:in `block in <top (required)>'
/home/pup/dev/ruby/bundler/bundler/Rakefile:23:in `block in invoke'
/home/pup/dev/ruby/bundler/bundler/Rakefile:22:in `invoke'
/home/pup/.gem/ruby/2.5.0/gems/rake-12.3.2/exe/rake:27:in `<top (required)>'
Tasks: TOP => spec
(See full trace by running task with --trace)

Can you run gem update --system and try again?

I rebooted like four times for unrelated reasons and now it runs but I get a ton of errors.
The errors all seem to be either this:
ERROR:  While executing gem ... (RuntimeError)
    Gem::Indexer requires that the XML Builder library be installed:
        gem install builder

or something like this, where it fails to fetch a source index from file:///...:
$ /usr/bin/ruby -I/home/pup/dev/ruby/bundler/bundler/lib:/home/pup/dev/ruby/bundler/bundler/spec \
  -rsupport/hax -r/home/pup/dev/ruby/bundler/bundler/spec/support/artifice/fail \
  /home/pup/dev/ruby/bundler/bundler/exe/bundle install --retry 0
Fetching source index from file:///home/pup/dev/ruby/bundler/bundler/tmp/gems/remote2/
Could not fetch specs from file:///home/pup/dev/ruby/bundler/bundler/tmp/gems/remote2/
# $? => 17

$ /usr/bin/ruby -I/home/pup/dev/ruby/bundler/bundler/lib:/home/pup/dev/ruby/bundler/bundler/spec \
  -rsupport/hax -r/home/pup/dev/ruby/bundler/bundler/spec/support/artifice/fail \
  /home/pup/dev/ruby/bundler/bundler/exe/bundle update halting-problem-solver
This Bundle hasn't been installed yet. Run `bundle install` to update and install the bundled gems.
# $? => 22

This is with MRI Ruby 2.5.5p157 and RubyGems 3.0.4.
I'm pretty sure my computer's haunted.

Can you rm -rf tmp and retry?

Same deal.

I don't understand what's going on, sorry... :(

So, 3 months later with new computer, and running Fedora 30 instead of Fedora 29. Unfortunately still not working.
Various version information:
~$ ruby --version
ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-linux]
~$ gem --version
3.0.6
~$ bundle --version
Bundler version 2.0.

`gem env`
RubyGems Environment:
  - RUBYGEMS VERSION: 3.0.6
  - RUBY VERSION: 2.6.3 (2019-04-16 patchlevel 62) [x86_64-linux]
  - INSTALLATION DIRECTORY: /usr/share/gems
  - USER INSTALLATION DIRECTORY: /home/puppy/.gem/ruby/2.6.0
  - RUBY EXECUTABLE: /usr/bin/ruby
  - GIT EXECUTABLE: /usr/bin/git
  - EXECUTABLE DIRECTORY: /usr/bin
  - SPEC CACHE DIRECTORY: /home/puppy/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /etc
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /usr/share/gems
     - /home/puppy/.gem/ruby/2.6.0
     - /usr/local/share/gems
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
     - "gem" => "--suggestions --user-install --no-document"
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /home/puppy/.cargo/bin
     - /home/puppy/.cargo/bin
     - /home/puppy/bin
     - /home/puppy/.local/bin
     - /home/puppy/.gem/ruby/bin
     - /home/puppy/.npm-global/bin
     - /home/puppy/go/bin
     - /usr/bin
     - /usr/sbin
     - /usr/local/bin
     - /usr/local/sbin
     - /home/puppy/.gem/ruby/2.6.0/bin
     - /var/lib/flatpak/exports//bin

First, I tried bin/rake spec:deps, but needed to install rake ~> 12.0. I did that, and then was able to run spec deps.

Logs from initial `bin/rake spec:deps`, installing rake, running `bin/rake spec:deps` again.
~/dev/ruby/bundler/bundler master+ bin/rake spec:deps
We couln't activate rake (~> 12.0). Run `gem install rake:'~> 12.0'`
~/dev/ruby/bundler/bundler master+ gem install 'rake:~> 12.0'
Fetching rake-12.3.3.gem
Successfully installed rake-12.3.3
1 gem installed
~/dev/ruby/bundler/bundler master+ bin/rake spec:deps
Fetching automatiek-0.3.0.gem
Successfully installed automatiek-0.3.0
Fetching parallel-1.17.0.gem
Fetching parallel_tests-2.29.2.gem
Successfully installed parallel-1.17.0
Successfully installed parallel_tests-2.29.2
Fetching ronn-0.7.3.gem
Fetching mustache-1.1.0.gem
Fetching rdiscount-<IP_ADDRESS>.gem
Fetching hpricot-0.8.6.gem
Successfully installed mustache-1.1.0
Building native extensions. This could take a while...
Successfully installed rdiscount-<IP_ADDRESS>
Building native extensions. This could take a while...
Successfully installed hpricot-0.8.6
Successfully installed ronn-0.7.3
Fetching rspec-mocks-3.8.1.gem
Fetching rspec-3.8.0.gem
Fetching rspec-support-3.8.2.gem
Fetching rspec-expectations-3.8.4.gem
Fetching diff-lcs-1.3.gem
Fetching rspec-core-3.8.2.gem
Successfully installed rspec-support-3.8.2
Successfully installed diff-lcs-1.3
Successfully installed rspec-mocks-3.8.1
Successfully installed rspec-expectations-3.8.4
Successfully installed rspec-core-3.8.2
Successfully installed rspec-3.8.0
Fetching unicode-display_width-1.6.0.gem
Fetching jaro_winkler-1.5.3.gem
Fetching ruby-progressbar-1.10.1.gem
Fetching ast-2.4.0.gem
Fetching parser-<IP_ADDRESS>.gem
Fetching rainbow-3.0.0.gem
Fetching rubocop-0.74.0.gem
Building native extensions. This could take a while...
Successfully installed jaro_winkler-1.5.3
Successfully installed ast-2.4.0
Successfully installed parser-<IP_ADDRESS>
Successfully installed rainbow-3.0.0
Successfully installed ruby-progressbar-1.10.1
Successfully installed unicode-display_width-1.6.0
Successfully installed rubocop-0.74.0
Fetching rubocop-performance-1.4.0.gem
Successfully installed rubocop-performance-1.4.0
21 gems installed
spec:deps ran for   0.000176   0.000028  16.636282 ( 20.866366)

However, when I ran the specs, I got a lot of errors again, including ones saying I needed the builder gem.
I installed the builder gem, and it still yields a ton of errors... including the ones saying I need the builder gem.

On a pristine run of the tests (after rm -rf tmp/), you should get the following output, which means that the test dependencies are getting installed:
bin/rspec

Randomized with seed 15802
installing gems for the tests to use...
Fetching rack-2.0.7.gem
Successfully installed rack-2.0.7
Fetching rack-test-1.1.0.gem
Successfully installed rack-test-1.1.0
Fetching artifice-0.6.gem
Successfully installed artifice-0.6
Fetching compact_index-0.11.0.gem
Successfully installed compact_index-0.11.0
Fetching mustermann-1.0.3.gem
Fetching rack-protection-2.0.7.gem
Fetching tilt-2.0.10.gem
Fetching sinatra-2.0.7.gem
Successfully installed tilt-2.0.10
Successfully installed rack-protection-2.0.7
Successfully installed mustermann-1.0.3
Successfully installed sinatra-2.0.7
Fetching rake-12.3.2.gem
Successfully installed rake-12.3.2
Fetching builder-3.2.3.gem
Successfully installed builder-3.2.3
Fetching ruby-graphviz-1.2.4.gem

You need to install GraphViz (http://graphviz.org/) to use this Gem.

For more information about Ruby-Graphviz :
* Doc : http://rdoc.info/projects/glejeune/Ruby-Graphviz
* Sources : https://github.com/glejeune/Ruby-Graphviz
* Mailing List : https://groups.google.com/forum/#!forum/ruby-graphviz

Last (important) changes :
Ruby-Graphviz no longer supports Ruby < 1.9.3

Successfully installed ruby-graphviz-1.2.4

If you're not getting this output, it sounds like at least we know where the problem is, and that's consistent with what you say about the builder gem being missing.

@deivid-rodriguez I found a way to reproduce it that isn't specific to my system!
$ docker run --rm -it -u $(id -u) -v "rgdev-home-bundler:/home/developer" -v "$(pwd):$(pwd)" -w "$(pwd)" whaledo/rgdev bin/rake spec:deps
<...>
21 gems installed
spec:deps ran for   0.000000   0.000311  15.639946 ( 21.940569)
$ docker run --rm -it -u $(id -u) -v "rgdev-home-bundler:/home/developer" -v "$(pwd):$(pwd)" -w "$(pwd)" whaledo/rgdev bin/rake spec
<...>
Finished in 14 minutes 40 seconds (files took 5.4 seconds to load)
2739 examples, 1183 failures, 4 pending
<...>
$

and the errors (which would be where the <...> immediately after the second command is) look to be the exact ones I've been encountering.

The entirety of the Dockerfile for that is pretty short, and based on Alpine, so perhaps the smaller target will make it easier to debug:
FROM alpine:3.10

ENV PATH "/usr/bin:/usr/sbin:/bin:/sbin:/home/developer/.gem/ruby/2.5.0/bin"

RUN apk add --no-cache git build-base shadow zip ruby ruby-etc ruby-irb ruby-json \
        ruby-rake ruby-rdoc ruby-webrick ruby-dev && \
      useradd --create-home developer && \
      echo "gem: --suggestions --user-install" > /etc/gemrc

USER developer

Using this Dockerfile:
FROM alpine:3.10

RUN apk add --no-cache git build-base zip ruby ruby-etc ruby-irb ruby-json \
        ruby-rake ruby-rdoc ruby-webrick ruby-dev

RUN git clone https://github.com/bundler/bundler.git /bundler

RUN cd /bundler && ./bin/rake spec:deps
RUN cd /bundler && ./bin/rake spec

Running docker build -t bundler-7169-testcase . results in 46 failures. Made a slight tweak and re-running, with output piped to a file, so I can provide the full output. (Forgot to do that before.)

Logs from that Docker command
Sending build context to Docker daemon  3.584kB

Step 1/5 : FROM alpine:3.10
 ---><PHONE_NUMBER>11
Step 2/5 : RUN apk add --no-cache git build-base zip ruby ruby-etc ruby-irb ruby-json         ruby-rake ruby-rdoc ruby-webrick ruby-dev sudo
 ---> Using cache
 ---> a1f5da7c4c86
Step 3/5 : RUN git clone https://github.com/bundler/bundler.git /bundler
 ---> Using cache
 ---> 7f122a0675ae
Step 4/5 : RUN cd /bundler && ./bin/rake spec:deps
 ---> Using cache
 ---> fdb1e12bec17
Step 5/5 : RUN cd /bundler && ./bin/rake spec
 ---> Running in c8fc9e756fa0
bin/rspec

Randomized with seed 62786
installing gems for the tests to use...
Successfully installed rack-2.0.7
Successfully installed rack-test-1.1.0
Successfully installed artifice-0.6
Successfully installed compact_index-0.11.0
Successfully installed tilt-2.0.10
Successfully installed rack-protection-2.0.7
Successfully installed mustermann-1.0.3
Successfully installed sinatra-2.0.7
Successfully installed rake-12.3.2
Successfully installed builder-3.2.3

You need to install GraphViz (http://graphviz.org/) to use this Gem.

For more information about Ruby-Graphviz :
* Doc : http://rdoc.info/projects/glejeune/Ruby-Graphviz
* Sources : https://github.com/glejeune/Ruby-Graphviz
* Mailing List : https://groups.google.com/forum/#!forum/ruby-graphviz

Last (important) changes :
Ruby-Graphviz no longer supports Ruby < 1.9.3

Successfully installed ruby-graphviz-1.2.4
11 gems installed
...............................F...............................................................................................................................................................................................................F.F.F................................................................F..................F..F.........................................................................................................................................................................................................................................................................................................................................................................................................FF..............................................F..........................................................................................................F..........................................................................................................................................................................................F.........................................................................................................................................................F.F.FF..F.....................................................................................................................................................................................................................F....F...............................................................................................................................F.........................FF.....F........................................................................................................................FF................FF...............F.FF.........F........................................................................................................................................................................................................................................................................F...............................FF.......F............................FF.FFFFFF..F*FF***.................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

Retried examples: 0

Pending: (Failures listed here are expected and do not affect your suite's status)

  1) bundle exec `load`ing a ruby file instead of `exec`ing regarding $0 and __FILE__ when the path is relative with a leading ./ relative paths with ./ have absolute __FILE__
     # Not yet implemented
     # ./spec/commands/exec_spec.rb:775

  2) bundle exec with default gems when specified in Gemfile directly uses version specified
     # irb isn't a default gem
     # ./spec/commands/exec_spec.rb:192

  3) bundle exec with default gems when specified in Gemfile indirectly uses resolved version
     # irb isn't a default gem
     # ./spec/commands/exec_spec.rb:224

  4) bundle exec with default gems when not specified in Gemfile uses version provided by ruby
     # irb isn't a default gem
     # ./spec/commands/exec_spec.rb:166

Failures:

  1) bundle clean when missing permissions returns a helpful error message
     Failure/Error: expect(err).to include(system_gem_path.to_s)

       expected "" to include "/bundler/tmp/1/gems/system"

       Commands:
       $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
         -r/bundler/spec/support/artifice/fail /bundler/exe/bundle install
       Fetching source index from file:///bundler/tmp/1/gems/remote1/
       Resolving dependencies...
       Using bundler 2.1.0.pre.2
       Fetching foo 1.0
       Installing foo 1.0
       Fetching rack 1.0.0
       Installing rack 1.0.0
       Bundle complete! 2 Gemfile dependencies, 3 gems now installed.
       Use `bundle info [gemname]` to see where a bundled gem is installed.
       Post-install message from rack:
       Rack's post install message
       Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
       # $? => 0

       $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
         -r/bundler/spec/support/artifice/fail /bundler/exe/bundle install
       Using bundler 2.1.0.pre.2
       Using rack 1.0.0
       Bundle complete! 1 Gemfile dependency, 2 gems now installed.
       Use `bundle info [gemname]` to see where a bundled gem is installed.
       Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
       # $? => 0

       $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
         -r/bundler/spec/support/artifice/fail /bundler/exe/bundle clean --force
       Removing foo (1.0)
       # $? => 0
     # ./spec/commands/clean_spec.rb:565:in `block (3 levels) in <top (required)>'
     # ./spec/spec_helper.rb:110:in `block (2 levels) in <top (required)>'
     # ./spec/spec_helper.rb:77:in `block (2 levels) in <top (required)>'
     # ./spec/support/rubygems_ext.rb:81:in `load'
     # ./spec/support/rubygems_ext.rb:81:in `gem_load_and_activate'
     # ./spec/support/rubygems_ext.rb:44:in `gem_load'

  2) Bundler#requires_sudo? bundle_path exists and is unwritable is expected to equal true
     Failure/Error: it { should be true }

       expected true
            got false
     # ./spec/bundler/bundler_spec.rb:370:in `block (5 levels) in <top (required)>'
     # ./spec/spec_helper.rb:110:in `block (2 levels) in <top (required)>'
     # ./spec/spec_helper.rb:77:in `block (2 levels) in <top (required)>'
     # ./spec/support/rubygems_ext.rb:81:in `load'
     # ./spec/support/rubygems_ext.rb:81:in `gem_load_and_activate'
     # ./spec/support/rubygems_ext.rb:44:in `gem_load'

  3) Bundler#requires_sudo? path writability unwritable paths should return true and display warn message
     Failure/Error: Bundler.ui.warn "Following files may not be writable, so sudo is needed:\n  #{unwritable_files.map(&:to_s).sort.join("\n  ")}"

       #<Bundler::UI::Silent:0x0000560d5a068110 @warnings=[]> received :warn with unexpected arguments
         expected: ("Following files may not be writable, so sudo is needed:\n  tmp/vendor/bin_dir/\n  tmp/vendor/bundle/unwritable1.txt\n  tmp/vendor/bundle/unwritable2.txt")
              got: ("Following files may not be writable, so sudo is needed:\n  tmp/vendor/bin_dir/")
       Diff:
       @@ -1,5 +1,3 @@
        Following files may not be writable, so sudo is needed:
          tmp/vendor/bin_dir/
       -  tmp/vendor/bundle/unwritable1.txt
       -  tmp/vendor/bundle/unwritable2.txt
     # ./lib/bundler.rb:431:in `requires_sudo?'
     # ./spec/bundler/bundler_spec.rb:416:in `block (5 levels) in <top (required)>'
     # ./spec/spec_helper.rb:110:in `block (2 levels) in <top (required)>'
     # ./spec/spec_helper.rb:77:in `block (2 levels) in <top (required)>'
     # ./spec/support/rubygems_ext.rb:81:in `load'
     # ./spec/support/rubygems_ext.rb:81:in `gem_load_and_activate'
     # ./spec/support/rubygems_ext.rb:44:in `gem_load'

  4) Bundler#requires_sudo? bundle_path doesn't exist and parent dir can't be written is expected to equal true
     Failure/Error: it { should be true }

       expected true
            got false
     # ./spec/bundler/bundler_spec.rb:341:in `block (5 levels) in <top (required)>'
     # ./spec/spec_helper.rb:110:in `block (2 levels) in <top (required)>'
     # ./spec/spec_helper.rb:77:in `block (2 levels) in <top (required)>'
     # ./spec/support/rubygems_ext.rb:81:in `load'
     # ./spec/support/rubygems_ext.rb:81:in `gem_load_and_activate'
     # ./spec/support/rubygems_ext.rb:44:in `gem_load'

  5) bundle install with explicit source paths handles directories in bin/
     Failure/Error: expect(err).to be_empty

       expected `"Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.".empty?` to return true, got false

       Commands:
       $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
         -r/bundler/spec/support/artifice/fail /bundler/exe/bundle install --retry 0
       Resolving dependencies...
       Using bundler 2.1.0.pre.2
       Using foo 1.0 from source at `/bundler/tmp/1/libs/foo-1.0`
       Bundle complete! 1 Gemfile dependency, 2 gems now installed.
       Use `bundle info [gemname]` to see where a bundled gem is installed.
       Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
       # $? => 0
     # ./spec/install/gemfile/path_spec.rb:359:in `block (2 levels) in <top (required)>'
     # ./spec/spec_helper.rb:110:in `block (2 levels) in <top (required)>'
     # ./spec/spec_helper.rb:77:in `block (2 levels) in <top (required)>'
     # ./spec/support/rubygems_ext.rb:81:in `load'
     # ./spec/support/rubygems_ext.rb:81:in `gem_load_and_activate'
     # ./spec/support/rubygems_ext.rb:44:in `gem_load'

  6) bundle install with explicit source paths gem install hooks runs post-install hooks
     Failure/Error: expect(err_without_deprecations).to eq("Ran post-install hook: foo-1.0")

       expected: "Ran post-install hook: foo-1.0"
            got: "Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as r...will break this application for all non-root users on this machine.\nRan post-install hook: foo-1.0"

       (compared using ==)

       Diff:
       @@ -1,2 +1,3 @@
       +Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
        Ran post-install hook: foo-1.0

       Commands:
       $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -r/bundler/tmp/1/libs/install_hooks.rb \
         -rsupport/rubygems -rsupport/hax -r/bundler/spec/support/artifice/fail /bundler/exe/bundle \
         install
       Fetching /bundler/tmp/1/libs/foo-1.0
       Resolving dependencies...
       Using bundler 2.1.0.pre.2
       Using foo 1.0 from /bundler/tmp/1/libs/foo-1.0 (at master@37c655b)
       Bundle complete! 1 Gemfile dependency, 2 gems now installed.
       Use `bundle info [gemname]` to see where a bundled gem is installed.
       Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
       Ran post-install hook: foo-1.0
       # $? => 0
     # ./spec/install/gemfile/path_spec.rb:703:in `block (3 levels) in <top (required)>'
     # ./spec/spec_helper.rb:110:in `block (2 levels) in <top (required)>'
     # ./spec/spec_helper.rb:77:in `block (2 levels) in <top (required)>'
     # ./spec/support/rubygems_ext.rb:81:in `load'
     # ./spec/support/rubygems_ext.rb:81:in `gem_load_and_activate'
     # ./spec/support/rubygems_ext.rb:44:in `gem_load'

  7) bundle install with explicit source paths gem install hooks runs pre-install hooks
     Failure/Error: expect(err_without_deprecations).to eq("Ran pre-install hook: foo-1.0")

       expected: "Ran pre-install hook: foo-1.0"
            got: "Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as r... will break this application for all non-root users on this machine.\nRan pre-install hook: foo-1.0"

       (compared using ==)

       Diff:
       @@ -1,2 +1,3 @@
       +Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
        Ran pre-install hook: foo-1.0

       Commands:
       $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -r/bundler/tmp/1/libs/install_hooks.rb \
         -rsupport/rubygems -rsupport/hax -r/bundler/spec/support/artifice/fail /bundler/exe/bundle \
         install
       Fetching /bundler/tmp/1/libs/foo-1.0
       Resolving dependencies...
       Using bundler 2.1.0.pre.2
       Using foo 1.0 from /bundler/tmp/1/libs/foo-1.0 (at master@56e7151)
       Bundle complete! 1 Gemfile dependency, 2 gems now installed.
       Use `bundle info [gemname]` to see where a bundled gem is installed.
       Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
       Ran pre-install hook: foo-1.0
       # $? => 0
     # ./spec/install/gemfile/path_spec.rb:683:in `block (3 levels) in <top (required)>'
     # ./spec/spec_helper.rb:110:in `block (2 levels) in <top (required)>'
     # ./spec/spec_helper.rb:77:in `block (2 levels) in <top (required)>'
     # ./spec/support/rubygems_ext.rb:81:in `load'
     # ./spec/support/rubygems_ext.rb:81:in `gem_load_and_activate'
     # ./spec/support/rubygems_ext.rb:44:in `gem_load'

  8) bundle doctor when home contains files that are not readable/writable when home contains files that are not owned by the current process exits with an error if home contains files that are not readable/writable and are not owned by the current user
     Failure/Error:
       expect(@stdout.string).to include(
         "Files exist in the Bundler home that are owned by another user, and are not readable/writable. These files are:\n - #{@unwritable_file}"
       )

       expected "Files exist in the Bundler home that are not readable/writable by the current user. These files are:\n - #[Double \"file\"]\n" to include "Files exist in the Bundler home that are owned by another user, and are not readable/writable. These files are:\n - #[Double \"file\"]"
       Diff:
       @@ -1,2 +1,3 @@
       -Files exist in the Bundler home that are owned by another user, and are not readable/writable. These files are:\n - #[Double "file"]
       +Files exist in the Bundler home that are not readable/writable by the current user. These files are:
       + - #[Double "file"]

       Commands:
       $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
         -r/bundler/spec/support/artifice/fail /bundler/exe/bundle install --retry 0
       Fetching source index from file:///bundler/tmp/1/gems/remote1/
       Resolving dependencies...
       Using bundler 2.1.0.pre.2
       Fetching rack 1.0.0
       Installing rack 1.0.0
       Bundle complete! 1 Gemfile dependency, 2 gems now installed.
       Use `bundle info [gemname]` to see where a bundled gem is installed.
       Post-install message from rack:
       Rack's post install message
       Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
       # $? => 0
     # ./spec/commands/doctor_spec.rb:99:in `block (4 levels) in <top (required)>'
     # ./spec/spec_helper.rb:110:in `block (2 levels) in <top (required)>'
     # ./spec/spec_helper.rb:77:in `block (2 levels) in <top (required)>'
     # ./spec/support/rubygems_ext.rb:81:in `load'
     # ./spec/support/rubygems_ext.rb:81:in `gem_load_and_activate'
     # ./spec/support/rubygems_ext.rb:44:in `gem_load'

  9) bundle doctor when home contains files that are not readable/writable when home contains files that are not owned by the current process exits with a warning if home contains files that are read/write but not owned by current user
     Failure/Error:
       expect(@stdout.string).to include(
         "Files exist in the Bundler home that are owned by another user, but are still readable/writable. These files are:\n - #{@unwritable_file}"
       )

       expected "" to include "Files exist in the Bundler home that are owned by another user, but are still readable/writable. These files are:\n - #[Double \"file\"]"
       Diff:
       @@ -1,2 +1 @@
       -Files exist in the Bundler home that are owned by another user, but are still readable/writable. These files are:\n - #[Double "file"]

       Commands:
       $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
         -r/bundler/spec/support/artifice/fail /bundler/exe/bundle install --retry 0
       Fetching source index from file:///bundler/tmp/1/gems/remote1/
       Resolving dependencies...
       Using bundler 2.1.0.pre.2
       Fetching rack 1.0.0
       Installing rack 1.0.0
       Bundle complete! 1 Gemfile dependency, 2 gems now installed.
       Use `bundle info [gemname]` to see where a bundled gem is installed.
       Post-install message from rack:
       Rack's post install message
       Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
       # $? => 0
     # ./spec/commands/doctor_spec.rb:109:in `block (4 levels) in <top (required)>'
     # ./spec/spec_helper.rb:110:in `block (2 levels) in <top (required)>'
     # ./spec/spec_helper.rb:77:in `block (2 levels) in <top (required)>'
     # ./spec/support/rubygems_ext.rb:81:in `load'
     # ./spec/support/rubygems_ext.rb:81:in `gem_load_and_activate'
     # ./spec/support/rubygems_ext.rb:44:in `gem_load'

  10) bundle install with gem sources when cached and locked does not reinstall already-installed gems
      Failure/Error: expect(err).to be_empty

        expected `"Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.".empty?` to return true, got false

        Commands:
        $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
          -r/bundler/spec/support/artifice/fail /bundler/exe/bundle install --retry 0
        Fetching source index from file:///bundler/tmp/1/gems/remote1/
        Resolving dependencies...
        Using bundler 2.1.0.pre.2
        Fetching rack 1.0.0
        Installing rack 1.0.0
        Bundle complete! 1 Gemfile dependency, 2 gems now installed.
        Use `bundle info [gemname]` to see where a bundled gem is installed.
        Post-install message from rack:
        Rack's post install message
        Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
        # $? => 0

        $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
          -r/bundler/spec/support/artifice/fail /bundler/exe/bundle pack
        Using bundler 2.1.0.pre.2
        Using rack 1.0.0
        Bundle complete! 1 Gemfile dependency, 2 gems now installed.
        Use `bundle info [gemname]` to see where a bundled gem is installed.
        Updating files in vendor/cache
          * rack-1.0.0.gem
        Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
        # $? => 0

        $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
          -r/bundler/spec/support/artifice/fail /bundler/exe/bundle install
        Using bundler 2.1.0.pre.2
        Using rack 1.0.0
        Updating files in vendor/cache
        Bundle complete! 1 Gemfile dependency, 2 gems now installed.
        Use `bundle info [gemname]` to see where a bundled gem is installed.
        Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
        # $? => 0
      # ./spec/commands/package_spec.rb:314:in `block (3 levels) in <top (required)>'
      # ./spec/spec_helper.rb:110:in `block (2 levels) in <top (required)>'
      # ./spec/spec_helper.rb:77:in `block (2 levels) in <top (required)>'
      # ./spec/support/rubygems_ext.rb:81:in `load'
      # ./spec/support/rubygems_ext.rb:81:in `gem_load_and_activate'
      # ./spec/support/rubygems_ext.rb:44:in `gem_load'

  11) Bundler.setup with bundler is located in symlinked GEM_HOME should not remove itself from the LOAD_PATH and require a different copy of 'bundler/setup'
      Failure/Error: expect(out).to be_empty

        expected `"OMG. Defining a class from another bundler at /usr/lib/ruby/2.5.0/rubygems/bundler_version_finder.rb:1".empty?` to return true, got false

        Commands:
        $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
          -r/bundler/spec/support/artifice/fail /bundler/exe/bundle install --retry 0
        Resolving dependencies...
        Bundle complete! 0 Gemfile dependencies, 1 gem now installed.
        Use `bundle info [gemname]` to see where a bundled gem is installed.
        Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
        The Gemfile specifies no dependencies
        # $? => 0

        $ GEM_PATH\=/bundler/tmp/1/tmpdir/gem_home20191025-9-vup33k /usr/bin/ruby -e  \
          <<EOS
                  TracePoint.trace(:class) do |tp|
                    if tp.path.include?("bundler") && !tp.path.start_with?("/bundler")
                      puts "OMG. Defining a class from another bundler at #{tp.path}:#{tp.lineno}"
                    end
                  end
                  gem 'bundler', '2.1.0.pre.2'
                  require 'bundler/setup'
        EOS
        OMG. Defining a class from another bundler at /usr/lib/ruby/2.5.0/rubygems/bundler_version_finder.rb:1
        # $? => 0
      # ./spec/runtime/setup_spec.rb:826:in `block (3 levels) in <top (required)>'
      # ./spec/spec_helper.rb:110:in `block (2 levels) in <top (required)>'
      # ./spec/spec_helper.rb:77:in `block (2 levels) in <top (required)>'
      # ./spec/support/rubygems_ext.rb:81:in `load'
      # ./spec/support/rubygems_ext.rb:81:in `gem_load_and_activate'
      # ./spec/support/rubygems_ext.rb:44:in `gem_load'

  12) bundle init when the dir is not writable by the current user notifies the user that it can not write to it
      Failure/Error: expect(err).to include("directory is not writable")

        expected "" to include "directory is not writable"

        Commands:
        $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
          -r/bundler/spec/support/artifice/fail /bundler/exe/bundle init
        Writing new Gemfile to /bundler/tmp/1/bundled_app/child_dir/Gemfile
        # $? => 0
      # ./spec/commands/init_spec.rb:57:in `block (3 levels) in <top (required)>'
      # ./spec/spec_helper.rb:110:in `block (2 levels) in <top (required)>'
      # ./spec/spec_helper.rb:77:in `block (2 levels) in <top (required)>'
      # ./spec/support/rubygems_ext.rb:81:in `load'
      # ./spec/support/rubygems_ext.rb:81:in `gem_load_and_activate'
      # ./spec/support/rubygems_ext.rb:44:in `gem_load'

  13) bundle binstubs <gem> when the gem exists in the lockfile the bundle binstub runs bundler
      Failure/Error: sys_exec! "#{bundled_app("bin/bundle")} install"

      RuntimeError:
        Invoking sys_exec!("/bundler/tmp/1/bundled_app/bin/bundle install") failed:
        Activating bundler (~> 2.1) failed:
        Could not find 'bundler' (2.1.0.pre.2) required by your /bundler/tmp/1/bundled_app/Gemfile.lock.
        To update to the latest version installed on your system, run `bundle update --bundler`.
        To install the missing version, run `gem install bundler:2.1.0.pre.2`
        Checked in 'GEM_PATH=/bundler/tmp/1/gems/system', execute `gem env` for more information

        To install the version of bundler this project requires, run `gem install bundler -v '~> 2.1'`

        Commands:
        $ /usr/bin/ruby --disable-gems -r/bundler/spec/support/rubygems -S gem --backtrace generate_index
        Generating Marshal quick index gemspecs for 2 gems
        ..
        Complete
        Generated Marshal quick index gemspecs: 0.001s
        Generating specs index
        Generated specs index: 0.000s
        Generating latest specs index
        Generated latest specs index: 0.000s
        Generating prerelease specs index
        Generated prerelease specs index: 0.000s
        Compressing indices
        Compressed indices: 0.000s
        # $? => 0

        $ /usr/bin/ruby --disable-gems -r/bundler/spec/support/rubygems -S gem --backtrace install \
          --no-document --ignore-dependencies /bundler/tmp/1/gems/remote4/gems/bundler-2.1.0.pre.2.gem
        Successfully installed bundler-2.1.0.pre.2
        1 gem installed
        # $? => 0

        $ /usr/bin/ruby --disable-gems -r/bundler/spec/support/rubygems -S gem --backtrace generate_index
        Generating Marshal quick index gemspecs for 65 gems
        .................................................................
        Complete
        Generated Marshal quick index gemspecs: 0.015s
        Generating specs index
        Generated specs index: 0.001s
        Generating latest specs index
        Generated latest specs index: 0.001s
        Generating prerelease specs index
        Generated prerelease specs index: 0.000s
        Compressing indices
        Compressed indices: 0.000s
        # $? => 0

        $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
          -r/bundler/spec/support/artifice/fail /bundler/exe/bundle install --retry 0
        Fetching source index from file:///bundler/tmp/1/gems/remote2/
        Resolving dependencies...
        Using bundler 2.1.0.pre.2
        Fetching prints_loaded_gems 1.0
        Installing prints_loaded_gems 1.0
        Fetching rack 1.2
        Installing rack 1.2
        Bundle complete! 2 Gemfile dependencies, 3 gems now installed.
        Use `bundle info [gemname]` to see where a bundled gem is installed.
        Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
        # $? => 0

        $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
          -r/bundler/spec/support/artifice/fail /bundler/exe/bundle binstubs bundler rack \
          prints_loaded_gems
        # $? => 0

        $ /bundler/tmp/1/bundled_app/bin/bundle install
        Activating bundler (~> 2.1) failed:
        Could not find 'bundler' (2.1.0.pre.2) required by your /bundler/tmp/1/bundled_app/Gemfile.lock.
        To update to the latest version installed on your system, run `bundle update --bundler`.
        To install the missing version, run `gem install bundler:2.1.0.pre.2`
        Checked in 'GEM_PATH=/bundler/tmp/1/gems/system', execute `gem env` for more information

        To install the version of bundler this project requires, run `gem install bundler -v '~> 2.1'`
        # $? => 42
      # ./spec/commands/binstubs_spec.rb:130:in `block (4 levels) in <top (required)>'
      # ./spec/spec_helper.rb:110:in `block (2 levels) in <top (required)>'
      # ./spec/spec_helper.rb:77:in `block (2 levels) in <top (required)>'
      # ./spec/support/rubygems_ext.rb:81:in `load'
      # ./spec/support/rubygems_ext.rb:81:in `gem_load_and_activate'
      # ./spec/support/rubygems_ext.rb:44:in `gem_load'

  14) bundle binstubs <gem> when the gem exists in the lockfile the bundle binstub when update --bundler is called calls through to the latest bundler version
      Failure/Error: sys_exec! "#{bundled_app("bin/bundle")} update --bundler"

      RuntimeError:
        Invoking sys_exec!("/bundler/tmp/1/bundled_app/bin/bundle update --bundler") failed:
        Activating bundler (~> 2.1) failed:
        Could not find 'bundler' (~> 2.1) - did find: [bundler-2.1.0.pre.2]
        Checked in 'GEM_PATH=/bundler/tmp/1/gems/system', execute `gem env` for more information

        To install the version of bundler this project requires, run `gem install bundler -v '~> 2.1'`

        Commands:
        $ /usr/bin/ruby --disable-gems -r/bundler/spec/support/rubygems -S gem --backtrace generate_index
        Generating Marshal quick index gemspecs for 2 gems
        ..
        Complete
        Generated Marshal quick index gemspecs: 0.001s
        Generating specs index
        Generated specs index: 0.000s
        Generating latest specs index
        Generated latest specs index: 0.000s
        Generating prerelease specs index
        Generated prerelease specs index: 0.000s
        Compressing indices
        Compressed indices: 0.000s
        # $? => 0

        $ /usr/bin/ruby --disable-gems -r/bundler/spec/support/rubygems -S gem --backtrace install \
          --no-document --ignore-dependencies /bundler/tmp/1/gems/remote4/gems/bundler-2.1.0.pre.2.gem
        Successfully installed bundler-2.1.0.pre.2
        1 gem installed
        # $? => 0

        $ /usr/bin/ruby --disable-gems -r/bundler/spec/support/rubygems -S gem --backtrace generate_index
        Generating Marshal quick index gemspecs for 65 gems
        .................................................................
        Complete
        Generated Marshal quick index gemspecs: 0.015s
        Generating specs index
        Generated specs index: 0.001s
        Generating latest specs index
        Generated latest specs index: 0.001s
        Generating prerelease specs index
        Generated prerelease specs index: 0.000s
        Compressing indices
        Compressed indices: 0.000s
        # $? => 0

        $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
          -r/bundler/spec/support/artifice/fail /bundler/exe/bundle install --retry 0
        Fetching source index from file:///bundler/tmp/1/gems/remote2/
        Resolving dependencies...
        Using bundler 2.1.0.pre.2
        Fetching prints_loaded_gems 1.0
        Installing prints_loaded_gems 1.0
        Fetching rack 1.2
        Installing rack 1.2
        Bundle complete! 2 Gemfile dependencies, 3 gems now installed.
        Use `bundle info [gemname]` to see where a bundled gem is installed.
        Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
        # $? => 0

        $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
          -r/bundler/spec/support/artifice/fail /bundler/exe/bundle binstubs bundler rack \
          prints_loaded_gems
        # $? => 0

        $ /bundler/tmp/1/bundled_app/bin/bundle update --bundler
        Activating bundler (~> 2.1) failed:
        Could not find 'bundler' (~> 2.1) - did find: [bundler-2.1.0.pre.2]
        Checked in 'GEM_PATH=/bundler/tmp/1/gems/system', execute `gem env` for more information

        To install the version of bundler this project requires, run `gem install bundler -v '~> 2.1'`
        # $? => 42
      # ./spec/commands/binstubs_spec.rb:183:in `block (5 levels) in <top (required)>'
      # ./spec/spec_helper.rb:110:in `block (2 levels) in <top (required)>'
      # ./spec/spec_helper.rb:77:in `block (2 levels) in <top (required)>'
      # ./spec/support/rubygems_ext.rb:81:in `load'
      # ./spec/support/rubygems_ext.rb:81:in `gem_load_and_activate'
      # ./spec/support/rubygems_ext.rb:44:in `gem_load'

  15) bundle binstubs <gem> when the gem exists in the lockfile the bundle binstub when a lockfile exists with a locked bundler version runs the correct version of bundler when the version is a pre-release
      Failure/Error: expect(exitstatus).to eq(42) if exitstatus

        expected: 42
             got: 1

        (compared using ==)

        Commands:
        $ /usr/bin/ruby --disable-gems -r/bundler/spec/support/rubygems -S gem --backtrace generate_index
        Generating Marshal quick index gemspecs for 2 gems
        ..
        Complete
        Generated Marshal quick index gemspecs: 0.001s
        Generating specs index
        Generated specs index: 0.000s
        Generating latest specs index
        Generated latest specs index: 0.000s
        Generating prerelease specs index
        Generated prerelease specs index: 0.000s
        Compressing indices
        Compressed indices: 0.000s
        # $? => 0

        $ /usr/bin/ruby --disable-gems -r/bundler/spec/support/rubygems -S gem --backtrace install \
          --no-document --ignore-dependencies /bundler/tmp/1/gems/remote4/gems/bundler-2.1.0.pre.2.gem
        Successfully installed bundler-2.1.0.pre.2
        1 gem installed
        # $? => 0

        $ /usr/bin/ruby --disable-gems -r/bundler/spec/support/rubygems -S gem --backtrace generate_index
        Generating Marshal quick index gemspecs for 65 gems
        .................................................................
        Complete
        Generated Marshal quick index gemspecs: 0.014s
        Generating specs index
        Generated specs index: 0.001s
        Generating latest specs index
        Generated latest specs index: 0.000s
        Generating prerelease specs index
        Generated prerelease specs index: 0.000s
        Compressing indices
        Compressed indices: 0.000s
        # $? => 0

        $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
          -r/bundler/spec/support/artifice/fail /bundler/exe/bundle install --retry 0
        Fetching source index from file:///bundler/tmp/1/gems/remote2/
        Resolving dependencies...
        Using bundler 2.1.0.pre.2
        Fetching prints_loaded_gems 1.0
        Installing prints_loaded_gems 1.0
        Fetching rack 1.2
        Installing rack 1.2
        Bundle complete! 2 Gemfile dependencies, 3 gems now installed.
        Use `bundle info [gemname]` to see where a bundled gem is installed.
        Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
        # $? => 0

        $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
          -r/bundler/spec/support/artifice/fail /bundler/exe/bundle binstubs bundler rack \
          prints_loaded_gems
        # $? => 0

        $ /bundler/tmp/1/bundled_app/bin/bundle install
        /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require': cannot load such file -- bundler/version (LoadError)
        	from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
        	from /bundler/spec/support/hax.rb:31:in `<top (required)>'
        	from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
        	from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
        # $? => 1
      # ./spec/commands/binstubs_spec.rb:173:in `block (5 levels) in <top (required)>'
      # ./spec/spec_helper.rb:110:in `block (2 levels) in <top (required)>'
      # ./spec/spec_helper.rb:77:in `block (2 levels) in <top (required)>'
      # ./spec/support/rubygems_ext.rb:81:in `load'
      # ./spec/support/rubygems_ext.rb:81:in `gem_load_and_activate'
      # ./spec/support/rubygems_ext.rb:44:in `gem_load'

  16) bundle binstubs <gem> when the gem exists in the lockfile the bundle binstub when a lockfile exists with a locked bundler version runs the correct version of bundler when the version is older and a different major
      Failure/Error: expect(exitstatus).to eq(42) if exitstatus

        expected: 42
             got: 1

        (compared using ==)

        Commands:
        $ /usr/bin/ruby --disable-gems -r/bundler/spec/support/rubygems -S gem --backtrace generate_index
        Generating Marshal quick index gemspecs for 2 gems
        ..
        Complete
        Generated Marshal quick index gemspecs: 0.001s
        Generating specs index
        Generated specs index: 0.000s
        Generating latest specs index
        Generated latest specs index: 0.000s
        Generating prerelease specs index
        Generated prerelease specs index: 0.000s
        Compressing indices
        Compressed indices: 0.000s
        # $? => 0

        $ /usr/bin/ruby --disable-gems -r/bundler/spec/support/rubygems -S gem --backtrace install \
          --no-document --ignore-dependencies /bundler/tmp/1/gems/remote4/gems/bundler-2.1.0.pre.2.gem
        Successfully installed bundler-2.1.0.pre.2
        1 gem installed
        # $? => 0

        $ /usr/bin/ruby --disable-gems -r/bundler/spec/support/rubygems -S gem --backtrace generate_index
        Generating Marshal quick index gemspecs for 65 gems
        .................................................................
        Complete
        Generated Marshal quick index gemspecs: 0.015s
        Generating specs index
        Generated specs index: 0.001s
        Generating latest specs index
        Generated latest specs index: 0.001s
        Generating prerelease specs index
        Generated prerelease specs index: 0.000s
        Compressing indices
        Compressed indices: 0.000s
        # $? => 0

        $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
          -r/bundler/spec/support/artifice/fail /bundler/exe/bundle install --retry 0
        Fetching source index from file:///bundler/tmp/1/gems/remote2/
        Resolving dependencies...
        Using bundler 2.1.0.pre.2
        Fetching prints_loaded_gems 1.0
        Installing prints_loaded_gems 1.0
        Fetching rack 1.2
        Installing rack 1.2
        Bundle complete! 2 Gemfile dependencies, 3 gems now installed.
        Use `bundle info [gemname]` to see where a bundled gem is installed.
        Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
        # $? => 0

        $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
          -r/bundler/spec/support/artifice/fail /bundler/exe/bundle binstubs bundler rack \
          prints_loaded_gems
        # $? => 0

        $ /bundler/tmp/1/bundled_app/bin/bundle install
        /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require': cannot load such file -- bundler/version (LoadError)
        	from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
        	from /bundler/spec/support/hax.rb:31:in `<top (required)>'
        	from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
        	from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
        # $? => 1
      # ./spec/commands/binstubs_spec.rb:156:in `block (5 levels) in <top (required)>'
      # ./spec/spec_helper.rb:110:in `block (2 levels) in <top (required)>'
      # ./spec/spec_helper.rb:77:in `block (2 levels) in <top (required)>'
      # ./spec/support/rubygems_ext.rb:81:in `load'
      # ./spec/support/rubygems_ext.rb:81:in `gem_load_and_activate'
      # ./spec/support/rubygems_ext.rb:44:in `gem_load'

  17) bundle binstubs <gem> when the gem exists in the lockfile the bundle binstub using another binstub loads all gems
      Failure/Error: sys_exec! bundled_app("bin/print_loaded_gems").to_s

      RuntimeError:
        Invoking sys_exec!("/bundler/tmp/1/bundled_app/bin/print_loaded_gems") failed:
        Activating bundler (~> 2.1) failed:
        Could not find 'bundler' (2.1.0.pre.2) required by your /bundler/tmp/1/bundled_app/Gemfile.lock.
        To update to the latest version installed on your system, run `bundle update --bundler`.
        To install the missing version, run `gem install bundler:2.1.0.pre.2`
        Checked in 'GEM_PATH=/bundler/tmp/1/gems/system', execute `gem env` for more information

        To install the version of bundler this project requires, run `gem install bundler -v '~> 2.1'`

        Commands:
        $ /usr/bin/ruby --disable-gems -r/bundler/spec/support/rubygems -S gem --backtrace build \
          /bundler/bundler.gemspec
        Successfully built RubyGem
          Name: bundler
          Version: 2.1.0.pre.2
          File: bundler-2.1.0.pre.2.gem
        # $? => 0

        $ /usr/bin/ruby --disable-gems -r/bundler/spec/support/rubygems -S gem --backtrace install \
          --no-document --ignore-dependencies /bundler/bundler-2.1.0.pre.2.gem
        Successfully installed bundler-2.1.0.pre.2
        1 gem installed
        # $? => 0

        $ /usr/bin/ruby --disable-gems -r/bundler/spec/support/rubygems -S gem --backtrace generate_index
        Generating Marshal quick index gemspecs for 65 gems
        .................................................................
        Complete
        Generated Marshal quick index gemspecs: 0.015s
        Generating specs index
        Generated specs index: 0.001s
        Generating latest specs index
        Generated latest specs index: 0.001s
        Generating prerelease specs index
        Generated prerelease specs index: 0.000s
        Compressing indices
        Compressed indices: 0.000s
        # $? => 0

        $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
          -r/bundler/spec/support/artifice/fail /bundler/exe/bundle install --retry 0
        Fetching source index from file:///bundler/tmp/1/gems/remote2/
        Resolving dependencies...
        Using bundler 2.1.0.pre.2
        Fetching prints_loaded_gems 1.0
        Installing prints_loaded_gems 1.0
        Fetching rack 1.2
        Installing rack 1.2
        Bundle complete! 2 Gemfile dependencies, 3 gems now installed.
        Use `bundle info [gemname]` to see where a bundled gem is installed.
        Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
        # $? => 0

        $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
          -r/bundler/spec/support/artifice/fail /bundler/exe/bundle binstubs bundler rack \
          prints_loaded_gems
        # $? => 0

        $ /bundler/tmp/1/bundled_app/bin/print_loaded_gems
        Activating bundler (~> 2.1) failed:
        Could not find 'bundler' (2.1.0.pre.2) required by your /bundler/tmp/1/bundled_app/Gemfile.lock.
        To update to the latest version installed on your system, run `bundle update --bundler`.
        To install the missing version, run `gem install bundler:2.1.0.pre.2`
        Checked in 'GEM_PATH=/bundler/tmp/1/gems/system', execute `gem env` for more information

        To install the version of bundler this project requires, run `gem install bundler -v '~> 2.1'`
        # $? => 42
      # ./spec/commands/binstubs_spec.rb:206:in `block (5 levels) in <top (required)>'
      # ./spec/spec_helper.rb:110:in `block (2 levels) in <top (required)>'
      # ./spec/spec_helper.rb:77:in `block (2 levels) in <top (required)>'
      # ./spec/support/rubygems_ext.rb:81:in `load'
      # ./spec/support/rubygems_ext.rb:81:in `gem_load_and_activate'
      # ./spec/support/rubygems_ext.rb:44:in `gem_load'

  18) bundle install with gem sources when bundle path does not have write access should display a proper message to explain the problem
      Failure/Error: expect(err).to include(bundled_app("vendor").to_s)

        expected "[DEPRECATED] The `--path` flag is deprecated because it relies on being remembered across bundler in... installing your bundle as root will break this application for all non-root users on this machine." to include "/bundler/tmp/1/bundled_app/vendor"
        Diff:
        @@ -1,2 +1,3 @@
        -/bundler/tmp/1/bundled_app/vendor
        +[DEPRECATED] The `--path` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set path 'vendor'`, and stop using this flag
        +Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.

        Commands:
        $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
          -r/bundler/spec/support/artifice/fail /bundler/exe/bundle install --path vendor
        Fetching source index from file:///bundler/tmp/1/gems/remote1/
        Resolving dependencies...
        Using bundler 2.1.0.pre.2
        Fetching rack 1.0.0
        Installing rack 1.0.0
        Bundle complete! 1 Gemfile dependency, 2 gems now installed.
        Bundled gems are installed into `./vendor`
        Post-install message from rack:
        Rack's post install message
        [DEPRECATED] The `--path` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set path 'vendor'`, and stop using this flag
        Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
        # $? => 0
      # ./spec/commands/install_spec.rb:552:in `block (3 levels) in <top (required)>'
      # ./spec/spec_helper.rb:110:in `block (2 levels) in <top (required)>'
      # ./spec/spec_helper.rb:77:in `block (2 levels) in <top (required)>'
      # ./spec/support/rubygems_ext.rb:81:in `load'
      # ./spec/support/rubygems_ext.rb:81:in `gem_load_and_activate'
      # ./spec/support/rubygems_ext.rb:44:in `gem_load'

  19) bundle install with gem sources when bundle install is executed with unencoded authentication should display a helpful message explaining how to fix it
      Failure/Error:
        expect(err).to eq("Please CGI escape your usernames and passwords before " \
                          "setting them for authentication.")

        expected: "Please CGI escape your usernames and passwords before setting them for authentication."
             got: "Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as r...is machine.\nPlease CGI escape your usernames and passwords before setting them for authentication."

        (compared using ==)

        Diff:
        @@ -1,2 +1,3 @@
        +Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
         Please CGI escape your usernames and passwords before setting them for authentication.

        Commands:
        $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
          -r/bundler/spec/support/artifice/fail /bundler/exe/bundle install
        Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
        Please CGI escape your usernames and passwords before setting them for authentication.
        # $? => 17
      # ./spec/commands/install_spec.rb:585:in `block (3 levels) in <top (required)>'
      # ./spec/spec_helper.rb:110:in `block (2 levels) in <top (required)>'
      # ./spec/spec_helper.rb:77:in `block (2 levels) in <top (required)>'
      # ./spec/support/rubygems_ext.rb:81:in `load'
      # ./spec/support/rubygems_ext.rb:81:in `gem_load_and_activate'
      # ./spec/support/rubygems_ext.rb:44:in `gem_load'

  20) compact index api installs the binstubs
      Failure/Error: expect(out).to eq("1.0.0")

        expected: "1.0.0"
             got: ""

        (compared using ==)

        Commands:
        $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
          -r/bundler/spec/support/artifice/compact_index /bundler/exe/bundle install --binstubs
        Fetching gem metadata from http://localgemserver.test/.
        Resolving dependencies...
        Using bundler 2.1.0.pre.2
        Fetching rack 1.0.0
        Installing rack 1.0.0
        Bundle complete! 1 Gemfile dependency, 2 gems now installed.
        Use `bundle info [gemname]` to see where a bundled gem is installed.
        Post-install message from rack:
        Rack's post install message
        Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
        [DEPRECATED] The --binstubs option will be removed in favor of `bundle binstubs`
        # $? => 0

        $ /bundler/tmp/1/bundled_app/bin/rackup
        Activating bundler (~> 2.1) failed:
        Could not find 'bundler' (~> 2.1) among 18 total gem(s)
        Checked in 'GEM_PATH=/bundler/tmp/1/gems/system', execute `gem env` for more information

        To install the version of bundler this project requires, run `gem install bundler -v '~> 2.1'`
        # $? => 42
      # ./spec/install/gems/compact_index_spec.rb:534:in `block (2 levels) in <top (required)>'
      # ./spec/spec_helper.rb:110:in `block (2 levels) in <top (required)>'
      # ./spec/spec_helper.rb:77:in `block (2 levels) in <top (required)>'
      # ./spec/support/rubygems_ext.rb:81:in `load'
      # ./spec/support/rubygems_ext.rb:81:in `gem_load_and_activate'
      # ./spec/support/rubygems_ext.rb:44:in `gem_load'

  21) bundle command names work when given fully
      Failure/Error: expect(err).to eq("Could not locate Gemfile")

        expected: "Could not locate Gemfile"
             got: "Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.\nCould not locate Gemfile"

        (compared using ==)

        Diff:
        @@ -1,2 +1,3 @@
        +Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
         Could not locate Gemfile

        Commands:
        $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
          -r/bundler/spec/support/artifice/fail /bundler/exe/bundle install
        Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
        Could not locate Gemfile
        # $? => 10
      # ./spec/other/cli_dispatch_spec.rb:6:in `block (2 levels) in <top (required)>'
      # ./spec/spec_helper.rb:110:in `block (2 levels) in <top (required)>'
      # ./spec/spec_helper.rb:77:in `block (2 levels) in <top (required)>'
      # ./spec/support/rubygems_ext.rb:81:in `load'
      # ./spec/support/rubygems_ext.rb:81:in `gem_load_and_activate'
      # ./spec/support/rubygems_ext.rb:44:in `gem_load'

  22) bundle command names work when not ambiguous
      Failure/Error: expect(err).to eq("Could not locate Gemfile")

        expected: "Could not locate Gemfile"
             got: "Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.\nCould not locate Gemfile"

        (compared using ==)

        Diff:
        @@ -1,2 +1,3 @@
        +Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
         Could not locate Gemfile

        Commands:
        $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
          -r/bundler/spec/support/artifice/fail /bundler/exe/bundle ins
        Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
        Could not locate Gemfile
        # $? => 10
      # ./spec/other/cli_dispatch_spec.rb:12:in `block (2 levels) in <top (required)>'
      # ./spec/spec_helper.rb:110:in `block (2 levels) in <top (required)>'
      # ./spec/spec_helper.rb:77:in `block (2 levels) in <top (required)>'
      # ./spec/support/rubygems_ext.rb:81:in `load'
      # ./spec/support/rubygems_ext.rb:81:in `gem_load_and_activate'
      # ./spec/support/rubygems_ext.rb:44:in `gem_load'

  23) Running bin/* commands use BUNDLE_GEMFILE gemfile for binstub
      Failure/Error: expect(exitstatus).to eq(0) if exitstatus

        expected: 0
             got: 42

        (compared using ==)

        Commands:
        $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
          -r/bundler/spec/support/artifice/fail /bundler/exe/bundle install --retry 0
        Fetching source index from file:///bundler/tmp/1/gems/remote1/
        Resolving dependencies...
        Using bundler 2.1.0.pre.2
        Fetching rack 1.0.0
        Installing rack 1.0.0
        Bundle complete! 1 Gemfile dependency, 2 gems now installed.
        Use `bundle info [gemname]` to see where a bundled gem is installed.
        Post-install message from rack:
        Rack's post install message
        Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
        # $? => 0

        $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
          -r/bundler/spec/support/artifice/fail /bundler/exe/bundle binstubs bundler
        # $? => 0

        $ /usr/bin/ruby --disable-gems -r/bundler/spec/support/rubygems -S gem --backtrace generate_index
        Generating Marshal quick index gemspecs for 65 gems
        .................................................................
        Complete
        Generated Marshal quick index gemspecs: 0.015s
        Generating specs index
        Generated specs index: 0.001s
        Generating latest specs index
        Generated latest specs index: 0.001s
        Generating prerelease specs index
        Generated prerelease specs index: 0.000s
        Compressing indices
        Compressed indices: 0.000s
        # $? => 0

        $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
          -r/bundler/spec/support/artifice/fail /bundler/exe/bundle install
        Fetching source index from file:///bundler/tmp/1/gems/remote2/
        Resolving dependencies...
        Fetching bindir 1.0
        Installing bindir 1.0
        Using bundler 2.1.0.pre.2
        Bundle complete! 1 Gemfile dependency, 2 gems now installed.
        Use `bundle info [gemname]` to see where a bundled gem is installed.
        Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
        # $? => 0

        $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
          -r/bundler/spec/support/artifice/fail /bundler/exe/bundle binstubs bindir
        # $? => 0

        $ /bundler/tmp/1/bundled_app/bin/foo
        Activating bundler (~> 2.1) failed:
        Could not find 'bundler' (~> 2.1) among 19 total gem(s)
        Checked in 'GEM_PATH=/bundler/tmp/1/gems/system', execute `gem env` for more information

        To install the version of bundler this project requires, run `gem install bundler -v '~> 2.1'`
        # $? => 42
      # ./spec/runtime/executable_spec.rb:170:in `block (2 levels) in <top (required)>'
      # ./spec/spec_helper.rb:110:in `block (2 levels) in <top (required)>'
      # ./spec/spec_helper.rb:77:in `block (2 levels) in <top (required)>'
      # ./spec/support/rubygems_ext.rb:81:in `load'
      # ./spec/support/rubygems_ext.rb:81:in `gem_load_and_activate'
      # ./spec/support/rubygems_ext.rb:44:in `gem_load'

  24) bundle install with git sources gem install hooks runs post-install hooks
      Failure/Error: expect(err_without_deprecations).to eq("Ran post-install hook: foo-1.0")

        expected: "Ran post-install hook: foo-1.0"
             got: "Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as r...will break this application for all non-root users on this machine.\nRan post-install hook: foo-1.0"

        (compared using ==)

        Diff:
        @@ -1,2 +1,3 @@
        +Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
         Ran post-install hook: foo-1.0

        Commands:
        $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -r/bundler/tmp/1/libs/install_hooks.rb \
          -rsupport/rubygems -rsupport/hax -r/bundler/spec/support/artifice/fail /bundler/exe/bundle \
          install
        Fetching /bundler/tmp/1/libs/foo-1.0
        Resolving dependencies...
        Using bundler 2.1.0.pre.2
        Using foo 1.0 from /bundler/tmp/1/libs/foo-1.0 (at master@e95dac0)
        Bundle complete! 1 Gemfile dependency, 2 gems now installed.
        Use `bundle info [gemname]` to see where a bundled gem is installed.
        Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
        Ran post-install hook: foo-1.0
        # $? => 0
      # ./spec/install/gemfile/git_spec.rb:1088:in `block (3 levels) in <top (required)>'
      # ./spec/spec_helper.rb:110:in `block (2 levels) in <top (required)>'
      # ./spec/spec_helper.rb:77:in `block (2 levels) in <top (required)>'
      # ./spec/support/rubygems_ext.rb:81:in `load'
      # ./spec/support/rubygems_ext.rb:81:in `gem_load_and_activate'
      # ./spec/support/rubygems_ext.rb:44:in `gem_load'

  25) bundle install with git sources gem install hooks runs pre-install hooks
      Failure/Error: expect(err_without_deprecations).to eq("Ran pre-install hook: foo-1.0")

        expected: "Ran pre-install hook: foo-1.0"
             got: "Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as r... will break this application for all non-root users on this machine.\nRan pre-install hook: foo-1.0"

        (compared using ==)

        Diff:
        @@ -1,2 +1,3 @@
        +Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
         Ran pre-install hook: foo-1.0

        Commands:
        $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -r/bundler/tmp/1/libs/install_hooks.rb \
          -rsupport/rubygems -rsupport/hax -r/bundler/spec/support/artifice/fail /bundler/exe/bundle \
          install
        Fetching /bundler/tmp/1/libs/foo-1.0
        Resolving dependencies...
        Using bundler 2.1.0.pre.2
        Using foo 1.0 from /bundler/tmp/1/libs/foo-1.0 (at master@df75a00)
        Bundle complete! 1 Gemfile dependency, 2 gems now installed.
        Use `bundle info [gemname]` to see where a bundled gem is installed.
        Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
        Ran pre-install hook: foo-1.0
        # $? => 0
      # ./spec/install/gemfile/git_spec.rb:1068:in `block (3 levels) in <top (required)>'
      # ./spec/spec_helper.rb:110:in `block (2 levels) in <top (required)>'
      # ./spec/spec_helper.rb:77:in `block (2 levels) in <top (required)>'
      # ./spec/support/rubygems_ext.rb:81:in `load'
      # ./spec/support/rubygems_ext.rb:81:in `gem_load_and_activate'
      # ./spec/support/rubygems_ext.rb:44:in `gem_load'

  26) bundle install with git sources when specifying local override explodes and gives correct solution if given path does not exist on install
      Failure/Error: expect(err).to be_empty

        expected `"Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.".empty?` to return true, got false

        Commands:
        $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
          -r/bundler/spec/support/artifice/fail /bundler/exe/bundle install --retry 0
        Fetching /bundler/tmp/1/libs/rack-0.8
        Fetching source index from file:///bundler/tmp/1/gems/remote1/
        Resolving dependencies...
        Using bundler 2.1.0.pre.2
        Using rack 0.8 from /bundler/tmp/1/libs/rack-0.8 (at master@74c7843)
        Bundle complete! 1 Gemfile dependency, 2 gems now installed.
        Use `bundle info [gemname]` to see where a bundled gem is installed.
        Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
        # $? => 0

        $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
          -r/bundler/spec/support/artifice/fail /bundler/exe/bundle config set local.rack \
          /bundler/tmp/1/libs/local-rack
        # $? => 0

        $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
          -r/bundler/spec/support/artifice/fail /bundler/exe/bundle install
        Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
        Cannot use local override for rack-0.8 because /bundler/tmp/1/libs/local-rack does not exist. Run `bundle config unset local.rack` to remove the local override
        # $? => 11

        $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
          -r/bundler/spec/support/artifice/fail /bundler/exe/bundle config unset local.rack
        # $? => 0

        $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
          -r/bundler/spec/support/artifice/fail /bundler/exe/bundle install
        Using bundler 2.1.0.pre.2
        Using rack 0.8 from /bundler/tmp/1/libs/rack-0.8 (at master@74c7843)
        Bundle complete! 1 Gemfile dependency, 2 gems now installed.
        Use `bundle info [gemname]` to see where a bundled gem is installed.
        Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
        # $? => 0
      # ./spec/install/gemfile/git_spec.rb:518:in `block (3 levels) in <top (required)>'
      # ./spec/spec_helper.rb:110:in `block (2 levels) in <top (required)>'
      # ./spec/spec_helper.rb:77:in `block (2 levels) in <top (required)>'
      # ./spec/support/rubygems_ext.rb:81:in `load'
      # ./spec/support/rubygems_ext.rb:81:in `gem_load_and_activate'
      # ./spec/support/rubygems_ext.rb:44:in `gem_load'

  27) bundle install with git sources when specifying local override explodes and gives correct solution if branch is not given on install
      Failure/Error: expect(err).to be_empty

        expected `"Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.".empty?` to return true, got false

        Commands:
        $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
          -r/bundler/spec/support/artifice/fail /bundler/exe/bundle install --retry 0
        Fetching /bundler/tmp/1/libs/rack-0.8
        Fetching source index from file:///bundler/tmp/1/gems/remote1/
        Resolving dependencies...
        Using bundler 2.1.0.pre.2
        Using rack 0.8 from /bundler/tmp/1/libs/rack-0.8 (at master@ee37d35)
        Bundle complete! 1 Gemfile dependency, 2 gems now installed.
        Use `bundle info [gemname]` to see where a bundled gem is installed.
        Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
        # $? => 0

        $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
          -r/bundler/spec/support/artifice/fail /bundler/exe/bundle config set local.rack \
          /bundler/tmp/1/libs/local-rack
        # $? => 0

        $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
          -r/bundler/spec/support/artifice/fail /bundler/exe/bundle install
        Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
        Cannot use local override for rack-0.8 at /bundler/tmp/1/libs/local-rack because :branch is not specified in Gemfile. Specify a branch or run `bundle config unset local.rack` to remove the local override
        # $? => 11

        $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
          -r/bundler/spec/support/artifice/fail /bundler/exe/bundle config unset local.rack
        # $? => 0

        $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
          -r/bundler/spec/support/artifice/fail /bundler/exe/bundle install
        Using bundler 2.1.0.pre.2
        Using rack 0.8 from /bundler/tmp/1/libs/rack-0.8 (at master@ee37d35)
        Bundle complete! 1 Gemfile dependency, 2 gems now installed.
        Use `bundle info [gemname]` to see where a bundled gem is installed.
        Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
        # $? => 0
      # ./spec/install/gemfile/git_spec.rb:540:in `block (3 levels) in <top (required)>'
      # ./spec/spec_helper.rb:110:in `block (2 levels) in <top (required)>'
      # ./spec/spec_helper.rb:77:in `block (2 levels) in <top (required)>'
      # ./spec/support/rubygems_ext.rb:81:in `load'
      # ./spec/support/rubygems_ext.rb:81:in `gem_load_and_activate'
      # ./spec/support/rubygems_ext.rb:44:in `gem_load'

  28) bundle install with git sources when specifying a revision works when the revision is a non-head ref
      Failure/Error: expect(err).to be_empty

        expected `"Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.".empty?` to return true, got false

        Commands:
        $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
          -r/bundler/spec/support/artifice/fail /bundler/exe/bundle install --retry 0
        Fetching /bundler/tmp/1/libs/foo-1.0
        Resolving dependencies...
        Using bundler 2.1.0.pre.2
        Using foo 1.0 from /bundler/tmp/1/libs/foo-1.0 (at refs/bundler/1@d84885c)
        Bundle complete! 1 Gemfile dependency, 2 gems now installed.
        Use `bundle info [gemname]` to see where a bundled gem is installed.
        Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
        # $? => 0
      # ./spec/install/gemfile/git_spec.rb:237:in `block (3 levels) in <top (required)>'
      # ./spec/spec_helper.rb:110:in `block (2 levels) in <top (required)>'
      # ./spec/spec_helper.rb:77:in `block (2 levels) in <top (required)>'
      # ./spec/support/rubygems_ext.rb:81:in `load'
      # ./spec/support/rubygems_ext.rb:81:in `gem_load_and_activate'
      # ./spec/support/rubygems_ext.rb:44:in `gem_load'

  29) bundle install with git sources when specifying a revision works when the revision is a non-head ref and it was previously downloaded
      Failure/Error: expect(err).to be_empty

        expected `"Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.".empty?` to return true, got false

        Commands:
        $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
          -r/bundler/spec/support/artifice/fail /bundler/exe/bundle install --retry 0
        Fetching /bundler/tmp/1/libs/foo-1.0
        Resolving dependencies...
        Using bundler 2.1.0.pre.2
        Using foo 1.0 from /bundler/tmp/1/libs/foo-1.0 (at master@5592287)
        Bundle complete! 1 Gemfile dependency, 2 gems now installed.
        Use `bundle info [gemname]` to see where a bundled gem is installed.
        Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
        # $? => 0

        $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
          -r/bundler/spec/support/artifice/fail /bundler/exe/bundle install --retry 0
        Fetching /bundler/tmp/1/libs/foo-1.0
        Resolving dependencies...
        Using bundler 2.1.0.pre.2
        Using foo 1.0 from /bundler/tmp/1/libs/foo-1.0 (at refs/bundler/1@5592287)
        Bundle complete! 1 Gemfile dependency, 2 gems now installed.
        Use `bundle info [gemname]` to see where a bundled gem is installed.
        Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
        # $? => 0
      # ./spec/install/gemfile/git_spec.rb:273:in `block (3 levels) in <top (required)>'
      # ./spec/spec_helper.rb:110:in `block (2 levels) in <top (required)>'
      # ./spec/spec_helper.rb:77:in `block (2 levels) in <top (required)>'
      # ./spec/support/rubygems_ext.rb:81:in `load'
      # ./spec/support/rubygems_ext.rb:81:in `gem_load_and_activate'
      # ./spec/support/rubygems_ext.rb:44:in `gem_load'

  30) bundle install with git sources when specifying a revision works when the revision is a symbol
      Failure/Error: expect(err).to be_empty

        expected `"Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.".empty?` to return true, got false

        Commands:
        $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
          -r/bundler/spec/support/artifice/fail /bundler/exe/bundle install --retry 0
        Fetching /bundler/tmp/1/libs/foo-1.0
        Resolving dependencies...
        Using bundler 2.1.0.pre.2
        Using foo 1.0 from /bundler/tmp/1/libs/foo-1.0 (at 3c4cd9a@3c4cd9a)
        Bundle complete! 1 Gemfile dependency, 2 gems now installed.
        Use `bundle info [gemname]` to see where a bundled gem is installed.
        Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
        # $? => 0
      # ./spec/install/gemfile/git_spec.rb:207:in `block (3 levels) in <top (required)>'
      # ./spec/spec_helper.rb:110:in `block (2 levels) in <top (required)>'
      # ./spec/spec_helper.rb:77:in `block (2 levels) in <top (required)>'
      # ./spec/support/rubygems_ext.rb:81:in `load'
      # ./spec/support/rubygems_ext.rb:81:in `gem_load_and_activate'
      # ./spec/support/rubygems_ext.rb:44:in `gem_load'

  31) gemcutter's dependency API installs the binstubs
      Failure/Error: expect(out).to eq("1.0.0")

        expected: "1.0.0"
             got: ""

        (compared using ==)

        Commands:
        $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
          -r/bundler/spec/support/artifice/endpoint /bundler/exe/bundle install --binstubs
        Fetching gem metadata from http://localgemserver.test/..
        Resolving dependencies...
        Using bundler 2.1.0.pre.2
        Fetching rack 1.0.0
        Installing rack 1.0.0
        Bundle complete! 1 Gemfile dependency, 2 gems now installed.
        Use `bundle info [gemname]` to see where a bundled gem is installed.
        Post-install message from rack:
        Rack's post install message
        Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
        [DEPRECATED] The --binstubs option will be removed in favor of `bundle binstubs`
        # $? => 0

        $ /bundler/tmp/1/bundled_app/bin/rackup
        Activating bundler (~> 2.1) failed:
        Could not find 'bundler' (~> 2.1) among 18 total gem(s)
        Checked in 'GEM_PATH=/bundler/tmp/1/gems/system', execute `gem env` for more information

        To install the version of bundler this project requires, run `gem install bundler -v '~> 2.1'`
        # $? => 42
      # ./spec/install/gems/dependency_api_spec.rb:508:in `block (2 levels) in <top (required)>'
      # ./spec/spec_helper.rb:110:in `block (2 levels) in <top (required)>'
      # ./spec/spec_helper.rb:77:in `block (2 levels) in <top (required)>'
      # ./spec/support/rubygems_ext.rb:81:in `load'
      # ./spec/support/rubygems_ext.rb:81:in `gem_load_and_activate'
      # ./spec/support/rubygems_ext.rb:44:in `gem_load'

  32) bundle update git sources notices when you change the repo url in the Gemfile
      Failure/Error: expect(err).to be_empty

        expected `"Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.".empty?` to return true, got false

        Commands:
        $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
          -r/bundler/spec/support/artifice/fail /bundler/exe/bundle install --retry 0
        Fetching /bundler/tmp/1/libs/foo_one
        Resolving dependencies...
        Using bundler 2.1.0.pre.2
        Using foo 1.0 from /bundler/tmp/1/libs/foo_one (at master@c52d62d)
        Bundle complete! 1 Gemfile dependency, 2 gems now installed.
        Use `bundle info [gemname]` to see where a bundled gem is installed.
        Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
        # $? => 0

        $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
          -r/bundler/spec/support/artifice/fail /bundler/exe/bundle install --retry 0
        Fetching /bundler/tmp/1/libs/foo_two
        Resolving dependencies...
        Using bundler 2.1.0.pre.2
        Using foo 1.0 from /bundler/tmp/1/libs/foo_two (at master@d45e4f7)
        Bundle complete! 1 Gemfile dependency, 2 gems now installed.
        Use `bundle info [gemname]` to see where a bundled gem is installed.
        Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
        # $? => 0
      # ./spec/update/git_spec.rb:91:in `block (3 levels) in <top (required)>'
      # ./spec/spec_helper.rb:110:in `block (2 levels) in <top (required)>'
      # ./spec/spec_helper.rb:77:in `block (2 levels) in <top (required)>'
      # ./spec/support/rubygems_ext.rb:81:in `load'
      # ./spec/support/rubygems_ext.rb:81:in `gem_load_and_activate'
      # ./spec/support/rubygems_ext.rb:44:in `gem_load'

  33) bundle install when a gem has a YAML gemspec still installs correctly
      Failure/Error: expect(err).to be_empty

        expected `"Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.".empty?` to return true, got false

        Commands:
        $ /usr/bin/ruby --disable-gems -r/bundler/spec/support/rubygems -S gem --backtrace generate_index
        Generating Marshal quick index gemspecs for 65 gems
        .................................................................
        Complete
        Generated Marshal quick index gemspecs: 0.017s
        Generating specs index
        Generated specs index: 0.002s
        Generating latest specs index
        Generated latest specs index: 0.001s
        Generating prerelease specs index
        Generated prerelease specs index: 0.000s
        Compressing indices
        Compressed indices: 0.000s
        # $? => 0

        $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
          -r/bundler/spec/support/artifice/fail /bundler/exe/bundle install
        Fetching source index from file:///bundler/tmp/1/gems/remote2/
        Resolving dependencies...
        Using bundler 2.1.0.pre.2
        Fetching yaml_spec 1.0
        Installing yaml_spec 1.0
        Bundle complete! 1 Gemfile dependency, 2 gems now installed.
        Use `bundle info [gemname]` to see where a bundled gem is installed.
        Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
        # $? => 0
      # ./spec/install/gemspecs_spec.rb:17:in `block (3 levels) in <top (required)>'
      # ./spec/spec_helper.rb:110:in `block (2 levels) in <top (required)>'
      # ./spec/spec_helper.rb:77:in `block (2 levels) in <top (required)>'
      # ./spec/support/rubygems_ext.rb:81:in `load'
      # ./spec/support/rubygems_ext.rb:81:in `gem_load_and_activate'
      # ./spec/support/rubygems_ext.rb:44:in `gem_load'

  34) bundle install when a gem has a YAML gemspec still installs correctly when using path
      Failure/Error: expect(err).to be_empty

        expected `"Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.".empty?` to return true, got false

        Commands:
        $ /usr/bin/ruby --disable-gems -r/bundler/spec/support/rubygems -S gem --backtrace generate_index
        Generating Marshal quick index gemspecs for 65 gems
        .................................................................
        Complete
        Generated Marshal quick index gemspecs: 0.014s
        Generating specs index
        Generated specs index: 0.001s
        Generating latest specs index
        Generated latest specs index: 0.001s
        Generating prerelease specs index
        Generated prerelease specs index: 0.000s
        Compressing indices
        Compressed indices: 0.000s
        # $? => 0

        $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
          -r/bundler/spec/support/artifice/fail /bundler/exe/bundle install --retry 0
        Resolving dependencies...
        Using bundler 2.1.0.pre.2
        Using yaml_spec 1.0 from source at `/bundler/tmp/1/libs/yaml_spec-1.0`
        Bundle complete! 1 Gemfile dependency, 2 gems now installed.
        Use `bundle info [gemname]` to see where a bundled gem is installed.
        Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
        # $? => 0
      # ./spec/install/gemspecs_spec.rb:26:in `block (3 levels) in <top (required)>'
      # ./spec/spec_helper.rb:110:in `block (2 levels) in <top (required)>'
      # ./spec/spec_helper.rb:77:in `block (2 levels) in <top (required)>'
      # ./spec/support/rubygems_ext.rb:81:in `load'
      # ./spec/support/rubygems_ext.rb:81:in `gem_load_and_activate'
      # ./spec/support/rubygems_ext.rb:44:in `gem_load'

  35) bundle exec respects custom process title when loading through ruby
      Failure/Error: expect(out).to eq("1-2-3-4-5-6-7-8-9-10-11-12-13-14-15")

        expected: "1-2-3-4-5-6-7-8-9-10-11-12-13-14-15"
             got: ""

        (compared using ==)

        Commands:
        $ /usr/bin/ruby -I/bundler/lib -e  \
          <<EOS
                    require "bundler"
                    begin
                      puts Bundler.bundle_path
                    rescue Bundler::GemfileNotFound
                      ENV["BUNDLE_GEMFILE"] = "Gemfile"
                      retry
                    end

        EOS
        /bundler/tmp/1/gems/system
        # $? => 0

        $ /usr/bin/ruby --disable-gems -r/bundler/spec/support/rubygems -S gem --backtrace install \
          --no-document --ignore-dependencies /bundler/tmp/1/gems/remote1/gems/rack-1.0.0.gem
        Rack's post install message
        Successfully installed rack-1.0.0
        1 gem installed
        # $? => 0

        $ /usr/bin/ruby --disable-gems -r/bundler/spec/support/rubygems -S gem --backtrace install \
          --no-document --ignore-dependencies /bundler/tmp/1/gems/remote1/gems/rack-0.9.1.gem
        Rack's post install message
        Successfully installed rack-0.9.1
        1 gem installed
        # $? => 0

        $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
          -r/bundler/spec/support/artifice/fail /bundler/exe/bundle exec ruby a.rb
        ps: unrecognized option: p
        BusyBox v1.30.1 (2019-06-12 17:51:55 UTC) multi-call binary.

        Usage: ps [-o COL1,COL2=HEADER]

        Show list of processes

        	-o COL1,COL2=HEADER	Select columns for display
        # $? => 0
      # ./spec/commands/exec_spec.rb:66:in `block (2 levels) in <top (required)>'
      # ./spec/spec_helper.rb:110:in `block (2 levels) in <top (required)>'
      # ./spec/spec_helper.rb:77:in `block (2 levels) in <top (required)>'
      # ./spec/support/rubygems_ext.rb:81:in `load'
      # ./spec/support/rubygems_ext.rb:81:in `gem_load_and_activate'
      # ./spec/support/rubygems_ext.rb:44:in `gem_load'

  36) bundle exec `load`ing a ruby file instead of `exec`ing when the executable exits non-zero via at_exit behaves like it runs like a normally executed executable
      Failure/Error: expect(err).to eq(expected_err)

        expected: ""
             got: "ps: unrecognized option: p\nBusyBox v1.30.1 (2019-06-12 17:51:55 UTC) multi-call binary.\n\nUsage: p...thod `strip' for nil:NilClass\n  /bundler/tmp/1/bundled_app/ruby_executable:8:in `<top (required)>'"

        (compared using ==)

        Diff:
        @@ -1 +1,12 @@
        +ps: unrecognized option: p
        +BusyBox v1.30.1 (2019-06-12 17:51:55 UTC) multi-call binary.
        +
        +Usage: ps [-o COL1,COL2=HEADER]
        +
        +Show list of processes
        +
        +	-o COL1,COL2=HEADER	Select columns for display
        +bundler: failed to load command: /bundler/tmp/1/bundled_app/ruby_executable (/bundler/tmp/1/bundled_app/ruby_executable)
        +NoMethodError: undefined method `strip' for nil:NilClass
        +  /bundler/tmp/1/bundled_app/ruby_executable:8:in `<top (required)>'

        Commands:
        $ /usr/bin/ruby -I/bundler/lib -e  \
          <<EOS
                    require "bundler"
                    begin
                      puts Bundler.bundle_path
                    rescue Bundler::GemfileNotFound
                      ENV["BUNDLE_GEMFILE"] = "Gemfile"
                      retry
                    end

        EOS
        /bundler/tmp/1/gems/system
        # $? => 0

        $ /usr/bin/ruby --disable-gems -r/bundler/spec/support/rubygems -S gem --backtrace install \
          --no-document --ignore-dependencies /bundler/tmp/1/gems/remote1/gems/rack-1.0.0.gem
        Rack's post install message
        Successfully installed rack-1.0.0
        1 gem installed
        # $? => 0

        $ /usr/bin/ruby --disable-gems -r/bundler/spec/support/rubygems -S gem --backtrace install \
          --no-document --ignore-dependencies /bundler/tmp/1/gems/remote1/gems/rack-0.9.1.gem
        Rack's post install message
        Successfully installed rack-0.9.1
        1 gem installed
        # $? => 0

        $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
          -r/bundler/spec/support/artifice/fail /bundler/exe/bundle install --retry 0
        Resolving dependencies...
        Using bundler 2.1.0.pre.2
        Using rack 1.0.0
        Bundle complete! 1 Gemfile dependency, 2 gems now installed.
        Use `bundle info [gemname]` to see where a bundled gem is installed.
        Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
        # $? => 0

        $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
          -r/bundler/spec/support/artifice/fail /bundler/exe/bundle exec \
          /bundler/tmp/1/bundled_app/ruby_executable arg1 arg2
        EXEC: load
        ARGS: /bundler/tmp/1/bundled_app/ruby_executable arg1 arg2
        RACK: 1.0.0
        ps: unrecognized option: p
        BusyBox v1.30.1 (2019-06-12 17:51:55 UTC) multi-call binary.

        Usage: ps [-o COL1,COL2=HEADER]

        Show list of processes

        	-o COL1,COL2=HEADER	Select columns for display
        bundler: failed to load command: /bundler/tmp/1/bundled_app/ruby_executable (/bundler/tmp/1/bundled_app/ruby_executable)
        NoMethodError: undefined method `strip' for nil:NilClass
          /bundler/tmp/1/bundled_app/ruby_executable:8:in `<top (required)>'
        # $? => 1
      Shared Example Group: "it runs" called from ./spec/commands/exec_spec.rb:737
      # ./spec/commands/exec_spec.rb:627:in `block (4 levels) in <top (required)>'
      # ./spec/spec_helper.rb:110:in `block (2 levels) in <top (required)>'
      # ./spec/spec_helper.rb:77:in `block (2 levels) in <top (required)>'
      # ./spec/support/rubygems_ext.rb:81:in `load'
      # ./spec/support/rubygems_ext.rb:81:in `gem_load_and_activate'
      # ./spec/support/rubygems_ext.rb:44:in `gem_load'

  37) bundle exec `load`ing a ruby file instead of `exec`ing when disable_exec_load is set behaves like it runs like a normally executed executable
      Failure/Error: expect(exitstatus).to eq(exit_code) if exitstatus

        expected: 0
             got: 1

        (compared using ==)

        Commands:
        $ /usr/bin/ruby -I/bundler/lib -e  \
          <<EOS
                    require "bundler"
                    begin
                      puts Bundler.bundle_path
                    rescue Bundler::GemfileNotFound
                      ENV["BUNDLE_GEMFILE"] = "Gemfile"
                      retry
                    end

        EOS
        /bundler/tmp/1/gems/system
        # $? => 0

        $ /usr/bin/ruby --disable-gems -r/bundler/spec/support/rubygems -S gem --backtrace install \
          --no-document --ignore-dependencies /bundler/tmp/1/gems/remote1/gems/rack-1.0.0.gem
        Rack's post install message
        Successfully installed rack-1.0.0
        1 gem installed
        # $? => 0

        $ /usr/bin/ruby --disable-gems -r/bundler/spec/support/rubygems -S gem --backtrace install \
          --no-document --ignore-dependencies /bundler/tmp/1/gems/remote1/gems/rack-0.9.1.gem
        Rack's post install message
        Successfully installed rack-0.9.1
        1 gem installed
        # $? => 0

        $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
          -r/bundler/spec/support/artifice/fail /bundler/exe/bundle install --retry 0
        Resolving dependencies...
        Using bundler 2.1.0.pre.2
        Using rack 1.0.0
        Bundle complete! 1 Gemfile dependency, 2 gems now installed.
        Use `bundle info [gemname]` to see where a bundled gem is installed.
        Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
        # $? => 0

        $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
          -r/bundler/spec/support/artifice/fail /bundler/exe/bundle config set disable_exec_load true
        # $? => 0

        $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
          -r/bundler/spec/support/artifice/fail /bundler/exe/bundle exec \
          /bundler/tmp/1/bundled_app/ruby_executable arg1 arg2
        EXEC: exec
        ARGS: /bundler/tmp/1/bundled_app/ruby_executable arg1 arg2
        RACK: 1.0.0
        ps: unrecognized option: p
        BusyBox v1.30.1 (2019-06-12 17:51:55 UTC) multi-call binary.

        Usage: ps [-o COL1,COL2=HEADER]

        Show list of processes

        	-o COL1,COL2=HEADER	Select columns for display
        /bundler/tmp/1/bundled_app/ruby_executable:8:in `<main>': undefined method `strip' for nil:NilClass (NoMethodError)
        # $? => 1
      Shared Example Group: "it runs" called from ./spec/commands/exec_spec.rb:748
      # ./spec/commands/exec_spec.rb:626:in `block (4 levels) in <top (required)>'
      # ./spec/spec_helper.rb:110:in `block (2 levels) in <top (required)>'
      # ./spec/spec_helper.rb:77:in `block (2 levels) in <top (required)>'
      # ./spec/support/rubygems_ext.rb:81:in `load'
      # ./spec/support/rubygems_ext.rb:81:in `gem_load_and_activate'
      # ./spec/support/rubygems_ext.rb:44:in `gem_load'

  38) bundle exec `load`ing a ruby file instead of `exec`ing the executable exits explicitly with exit 99 behaves like it runs like a normally executed executable
      Failure/Error: expect(exitstatus).to eq(exit_code) if exitstatus

        expected: 99
             got: 1

        (compared using ==)

        Commands:
        $ /usr/bin/ruby -I/bundler/lib -e  \
          <<EOS
                    require "bundler"
                    begin
                      puts Bundler.bundle_path
                    rescue Bundler::GemfileNotFound
                      ENV["BUNDLE_GEMFILE"] = "Gemfile"
                      retry
                    end

        EOS
        /bundler/tmp/1/gems/system
        # $? => 0

        $ /usr/bin/ruby --disable-gems -r/bundler/spec/support/rubygems -S gem --backtrace install \
          --no-document --ignore-dependencies /bundler/tmp/1/gems/remote1/gems/rack-1.0.0.gem
        Rack's post install message
        Successfully installed rack-1.0.0
        1 gem installed
        # $? => 0

        $ /usr/bin/ruby --disable-gems -r/bundler/spec/support/rubygems -S gem --backtrace install \
          --no-document --ignore-dependencies /bundler/tmp/1/gems/remote1/gems/rack-0.9.1.gem
        Rack's post install message
        Successfully installed rack-0.9.1
        1 gem installed
        # $? => 0

        $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
          -r/bundler/spec/support/artifice/fail /bundler/exe/bundle install --retry 0
        Resolving dependencies...
        Using bundler 2.1.0.pre.2
        Using rack 1.0.0
        Bundle complete! 1 Gemfile dependency, 2 gems now installed.
        Use `bundle info [gemname]` to see where a bundled gem is installed.
        Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
        # $? => 0

        $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
          -r/bundler/spec/support/artifice/fail /bundler/exe/bundle exec \
          /bundler/tmp/1/bundled_app/ruby_executable arg1 arg2
        EXEC: load
        ARGS: /bundler/tmp/1/bundled_app/ruby_executable arg1 arg2
        RACK: 1.0.0
        ps: unrecognized option: p
        BusyBox v1.30.1 (2019-06-12 17:51:55 UTC) multi-call binary.

        Usage: ps [-o COL1,COL2=HEADER]

        Show list of processes

        	-o COL1,COL2=HEADER	Select columns for display
        bundler: failed to load command: /bundler/tmp/1/bundled_app/ruby_executable (/bundler/tmp/1/bundled_app/ruby_executable)
        NoMethodError: undefined method `strip' for nil:NilClass
          /bundler/tmp/1/bundled_app/ruby_executable:8:in `<top (required)>'
        # $? => 1
      Shared Example Group: "it runs" called from ./spec/commands/exec_spec.rb:643
      # ./spec/commands/exec_spec.rb:626:in `block (4 levels) in <top (required)>'
      # ./spec/spec_helper.rb:110:in `block (2 levels) in <top (required)>'
      # ./spec/spec_helper.rb:77:in `block (2 levels) in <top (required)>'
      # ./spec/support/rubygems_ext.rb:81:in `load'
      # ./spec/support/rubygems_ext.rb:81:in `gem_load_and_activate'
      # ./spec/support/rubygems_ext.rb:44:in `gem_load'

  39) bundle exec `load`ing a ruby file instead of `exec`ing the executable exits explicitly with exit 0 behaves like it runs like a normally executed executable
      Failure/Error: expect(exitstatus).to eq(exit_code) if exitstatus

        expected: 0
             got: 1

        (compared using ==)

        Commands:
        $ /usr/bin/ruby -I/bundler/lib -e  \
          <<EOS
                    require "bundler"
                    begin
                      puts Bundler.bundle_path
                    rescue Bundler::GemfileNotFound
                      ENV["BUNDLE_GEMFILE"] = "Gemfile"
                      retry
                    end

        EOS
        /bundler/tmp/1/gems/system
        # $? => 0

        $ /usr/bin/ruby --disable-gems -r/bundler/spec/support/rubygems -S gem --backtrace install \
          --no-document --ignore-dependencies /bundler/tmp/1/gems/remote1/gems/rack-1.0.0.gem
        Rack's post install message
        Successfully installed rack-1.0.0
        1 gem installed
        # $? => 0

        $ /usr/bin/ruby --disable-gems -r/bundler/spec/support/rubygems -S gem --backtrace install \
          --no-document --ignore-dependencies /bundler/tmp/1/gems/remote1/gems/rack-0.9.1.gem
        Rack's post install message
        Successfully installed rack-0.9.1
        1 gem installed
        # $? => 0

        $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
          -r/bundler/spec/support/artifice/fail /bundler/exe/bundle install --retry 0
        Resolving dependencies...
        Using bundler 2.1.0.pre.2
        Using rack 1.0.0
        Bundle complete! 1 Gemfile dependency, 2 gems now installed.
        Use `bundle info [gemname]` to see where a bundled gem is installed.
        Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
        # $? => 0

        $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
          -r/bundler/spec/support/artifice/fail /bundler/exe/bundle exec \
          /bundler/tmp/1/bundled_app/ruby_executable arg1 arg2
        EXEC: load
        ARGS: /bundler/tmp/1/bundled_app/ruby_executable arg1 arg2
        RACK: 1.0.0
        ps: unrecognized option: p
        BusyBox v1.30.1 (2019-06-12 17:51:55 UTC) multi-call binary.

        Usage: ps [-o COL1,COL2=HEADER]

        Show list of processes

        	-o COL1,COL2=HEADER	Select columns for display
        bundler: failed to load command: /bundler/tmp/1/bundled_app/ruby_executable (/bundler/tmp/1/bundled_app/ruby_executable)
        NoMethodError: undefined method `strip' for nil:NilClass
          /bundler/tmp/1/bundled_app/ruby_executable:8:in `<top (required)>'
        # $? => 1
      Shared Example Group: "it runs" called from ./spec/commands/exec_spec.rb:638
      # ./spec/commands/exec_spec.rb:626:in `block (4 levels) in <top (required)>'
      # ./spec/spec_helper.rb:110:in `block (2 levels) in <top (required)>'
      # ./spec/spec_helper.rb:77:in `block (2 levels) in <top (required)>'
      # ./spec/support/rubygems_ext.rb:81:in `load'
      # ./spec/support/rubygems_ext.rb:81:in `gem_load_and_activate'
      # ./spec/support/rubygems_ext.rb:44:in `gem_load'

  40) bundle exec `load`ing a ruby file instead of `exec`ing when the file uses the current ruby shebang behaves like it runs like a normally executed executable
      Failure/Error: expect(exitstatus).to eq(exit_code) if exitstatus

        expected: 0
             got: 1

        (compared using ==)

        Commands:
        $ /usr/bin/ruby -I/bundler/lib -e  \
          <<EOS
                    require "bundler"
                    begin
                      puts Bundler.bundle_path
                    rescue Bundler::GemfileNotFound
                      ENV["BUNDLE_GEMFILE"] = "Gemfile"
                      retry
                    end

        EOS
        /bundler/tmp/1/gems/system
        # $? => 0

        $ /usr/bin/ruby --disable-gems -r/bundler/spec/support/rubygems -S gem --backtrace install \
          --no-document --ignore-dependencies /bundler/tmp/1/gems/remote1/gems/rack-1.0.0.gem
        Rack's post install message
        Successfully installed rack-1.0.0
        1 gem installed
        # $? => 0

        $ /usr/bin/ruby --disable-gems -r/bundler/spec/support/rubygems -S gem --backtrace install \
          --no-document --ignore-dependencies /bundler/tmp/1/gems/remote1/gems/rack-0.9.1.gem
        Rack's post install message
        Successfully installed rack-0.9.1
        1 gem installed
        # $? => 0

        $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
          -r/bundler/spec/support/artifice/fail /bundler/exe/bundle install --retry 0
        Resolving dependencies...
        Using bundler 2.1.0.pre.2
        Using rack 1.0.0
        Bundle complete! 1 Gemfile dependency, 2 gems now installed.
        Use `bundle info [gemname]` to see where a bundled gem is installed.
        Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
        # $? => 0

        $ /usr/bin/ruby --disable-gems -I/bundler/lib:/bundler/spec -rsupport/rubygems -rsupport/hax \
          -r/bundler/spec/support/artifice/fail /bundler/exe/bundle exec \
          /bundler/tmp/1/bundled_app/ruby_executable arg1 arg2
        EXEC: load
        ARGS: /bundler/tmp/1/bundled_app/ruby_executable arg1 arg2
        RACK: 1.0.0
        ps: unrecognized option: p
        BusyBox v1.30.1 (2019-06-12 17:51:55 UTC) multi-call binary.

        Usage: ps [-o COL1,COL2=HEADER]

        Show list of processes

        	-o COL1,COL2=HEADER	Select columns for display
        bundler: failed to load command: /bundler/tmp/1/bundled_app/ruby_executable (/bundler/tmp/1/bundled_app/ruby_executable)
        NoMethodError: undefined method `strip' for nil:NilClass
          /bundler/tmp/1/bundled_app/ruby_executable:8:in `<top (required)>'
        # $? => 1
      Shared Example Group: "it runs" called from ./spec/commands/exec_spec.rb:693
      # ./spec/commands/exec_spec.rb:626:in `block (4 levels) in <top (required)>'
      # ./spec/spec_helper.rb:110:in `block (2 levels) in <top (required)>'
      # ./spec/spec_helper.rb:77:in `block (2 levels) in <top (required)>'
      # ./spec/support/rubygems_ext.rb:81:in `load'
      # ./spec/support/rubygems_ext.rb:81:in `gem_load_and_activate'