Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Bundler 1.16.3 results in load error #6629

Closed
oliverguenther opened this issue Jul 17, 2018 · 9 comments
Closed

Bundler 1.16.3 results in load error #6629

oliverguenther opened this issue Jul 17, 2018 · 9 comments

Comments

@oliverguenther
Copy link

Our travis environment started failing this morning after the release of 1.16.3. It is connected to parallel_test trying to execute in a bundle context despite bundler already loaded.

bundle exec parallel_test --type cucumber -o ' -p rerun -r /home/travis/build/opf/openproject/features' -n 1 --only-group 1 features
/home/travis/.rvm/gems/ruby-2.5.1/bin/bundle:23:in `load': cannot load such file -- /home/travis/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.16.3/exe/bundle (LoadError)
	from /home/travis/.rvm/gems/ruby-2.5.1/bin/bundle:23:in `<main>'
	from /home/travis/.rvm/gems/ruby-2.5.1/bin/ruby_executable_hooks:24:in `eval'
	from /home/travis/.rvm/gems/ruby-2.5.1/bin/ruby_executable_hooks:24:in `<main>'
rake aborted!
Command failed with status (1): [bundle exec parallel_test --type cucumber ...]
/home/travis/build/opf/openproject/lib/tasks/parallel_testing.rake:132:in `block (2 levels) in <top (required)>'
/home/travis/build/opf/openproject/vendor/bundle/ruby/2.5.0/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
/home/travis/.rvm/gems/ruby-2.5.1/gems/bundler-1.16.3/lib/bundler/cli/exec.rb:74:in `load'
/home/travis/.rvm/gems/ruby-2.5.1/gems/bundler-1.16.3/lib/bundler/cli/exec.rb:74:in `kernel_load'
/home/travis/.rvm/gems/ruby-2.5.1/gems/bundler-1.16.3/lib/bundler/cli/exec.rb:28:in `run'
/home/travis/.rvm/gems/ruby-2.5.1/gems/bundler-1.16.3/lib/bundler/cli.rb:424:in `exec'
/home/travis/.rvm/gems/ruby-2.5.1/gems/bundler-1.16.3/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/home/travis/.rvm/gems/ruby-2.5.1/gems/bundler-1.16.3/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/home/travis/.rvm/gems/ruby-2.5.1/gems/bundler-1.16.3/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
/home/travis/.rvm/gems/ruby-2.5.1/gems/bundler-1.16.3/lib/bundler/cli.rb:27:in `dispatch'
/home/travis/.rvm/gems/ruby-2.5.1/gems/bundler-1.16.3/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
/home/travis/.rvm/gems/ruby-2.5.1/gems/bundler-1.16.3/lib/bundler/cli.rb:18:in `start'
/home/travis/.rvm/gems/ruby-2.5.1/gems/bundler-1.16.3/exe/bundle:30:in `block in <top (required)>'
/home/travis/.rvm/gems/ruby-2.5.1/gems/bundler-1.16.3/lib/bundler/friendly_errors.rb:124:in `with_friendly_errors'
/home/travis/.rvm/gems/ruby-2.5.1/gems/bundler-1.16.3/exe/bundle:22:in `<top (required)>'
/home/travis/.rvm/gems/ruby-2.5.1/bin/bundle:23:in `load'
/home/travis/.rvm/gems/ruby-2.5.1/bin/bundle:23:in `<main>'
/home/travis/.rvm/gems/ruby-2.5.1/bin/ruby_executable_hooks:24:in `eval'
/home/travis/.rvm/gems/ruby-2.5.1/bin/ruby_executable_hooks:24:in `<main>'
Tasks: TOP => parallel:cucumber
(See full trace by running task with --trace)

This PR rolling back to 1.16.2 results in correct execution:

https://travis-ci.org/opf/openproject/jobs/404795702 (Change behind that is opf/openproject#6432).

vs. it breaking with 1.16.3

https://travis-ci.org/opf/openproject/jobs/404746397

Please let me know if and how I can provide further insight in that failure from our side. Is it a regression? has a change in 1.16.3 affected something? shouldn't this have worked in the first place?

@colby-swandale
Copy link
Member

colby-swandale commented Jul 17, 2018

I have a feeling that this may be the same issue as #6537. I suggest fixing your version of Bundler to 1.16.2 for the time being

@oliverguenther
Copy link
Author

Yes, that does help indeed. It also only occurs in that nested bundle context, the other jobs are working fine.

@bastelfreak
Copy link

Hey everybody. I think the Vox Pupuli org (https://travis-ci.org/voxpupuli/puppet-archive) got his by this as well. We see this error on ruby2.1.9, 2.4.4 and 2.5.1 under certain constraints that I did not yet discovered.

@leosarra
Copy link

leosarra commented Jul 18, 2018

Same problem for me with ruby 2.5.1 (on Travis).
When I executed bundle exec rake cucumber it raised a loadError(), bundle exec cucumber instead worked like a charm.
I temporarily rolled back to 1.16.2 and everything is working again.

benoittgt added a commit to benoittgt/rspec-rails that referenced this issue Jul 20, 2018
See: rubygems/bundler#6629
Should be changed when fixed on next bundler release
benoittgt added a commit to rspec/rspec-rails that referenced this issue Jul 20, 2018
…der 2.2 (#2013)

Puma now requires Ruby 2.2 minimum

See: https://github.com/puma/puma/pull/1506/files

Also specify bundler version because of: rubygems/bundler#6629
Specific version should be removed when the issue is fixed on next release of bundler.
fetzerch added a commit to fetzerch/fetzerch.github.io that referenced this issue Jul 20, 2018
Upstream ticket: rubygems/bundler#6629

$ bundle exec rake test
bundle exec jekyll build --trace --drafts
----- Build site -----
/usr/local/bundle/bin/bundle:23:in `load': cannot load such file -- /usr/local/lib/ruby/gems/2.5.0/gems/bundler-1.16.3/exe/bundle (LoadError)
        from /usr/local/bundle/bin/bundle:23:in `<main>'
rake aborted!
Command failed with status (1): [bundle exec jekyll build --trace --drafts...]
/builds/project-0/Rakefile:14:in `block in <top (required)>'
/cache/bundler/ruby/2.5.0/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
/usr/local/bundle/gems/bundler-1.16.3/lib/bundler/cli/exec.rb:74:in `load'
/usr/local/bundle/gems/bundler-1.16.3/lib/bundler/cli/exec.rb:74:in `kernel_load'
/usr/local/bundle/gems/bundler-1.16.3/lib/bundler/cli/exec.rb:28:in `run'
/usr/local/bundle/gems/bundler-1.16.3/lib/bundler/cli.rb:424:in `exec'
/usr/local/bundle/gems/bundler-1.16.3/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/usr/local/bundle/gems/bundler-1.16.3/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/usr/local/bundle/gems/bundler-1.16.3/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
/usr/local/bundle/gems/bundler-1.16.3/lib/bundler/cli.rb:27:in `dispatch'
/usr/local/bundle/gems/bundler-1.16.3/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
/usr/local/bundle/gems/bundler-1.16.3/lib/bundler/cli.rb:18:in `start'
/usr/local/bundle/gems/bundler-1.16.3/exe/bundle:30:in `block in <top (required)>'
/usr/local/bundle/gems/bundler-1.16.3/lib/bundler/friendly_errors.rb:124:in `with_friendly_errors'
/usr/local/bundle/gems/bundler-1.16.3/exe/bundle:22:in `<top (required)>'
/usr/local/bundle/bin/bundle:23:in `load'
/usr/local/bundle/bin/bundle:23:in `<main>'
@graywolf
Copy link

I'm not sure if I'm supposed to +1 on github but I've encountered this issue
too, for me it's locally, not in travis.

/home/wolf/.gem/ruby/2.5.0/bin/bundle:23:in `load': cannot load such file -- /usr/lib/ruby/gems/2.5.0/gems/bundler-1.16.3/exe/bundle (LoadError)
	from /home/wolf/.gem/ruby/2.5.0/bin/bundle:23:in `<main>'

I'm not sure why it's even trying to load the file from that location,
bundle 1.16.3 is installed in user folder:

   $ ls -al .gem/ruby/2.5.0/gems/ | grep bundler
drwxr-xr-x 1 wolf wolf 110 Jul 29 22:14 bundler-1.16.3
   $ ls -al /usr/lib/ruby/gems/2.5.0/gems/
total 0
drwxr-xr-x 1 root root 160 Jul  2 06:27 .
drwxr-xr-x 1 root root  92 Feb 17 23:51 ..
drwxr-xr-x 1 root root   6 Feb 17 23:53 bundler-1.16.1
drwxr-xr-x 1 root root   6 May 19 20:09 bundler-1.16.2
drwxr-xr-x 1 root root 416 Jul  2 06:27 rdoc-6.0.4
drwxr-xr-x 1 root root 550 Feb 17 23:52 rubygems-update-2.7.6
drwxr-xr-x 1 root root 550 May 19 20:08 rubygems-update-2.7.7

Reverting to 1.16.2 fixes the issue for me (probably since it's in the
system folder).

rbclark added a commit to rbclark/carrierwave that referenced this issue Aug 2, 2018
It seems rubygems/bundler#6629 may be breaking the builds, locking to 1.16.2 for now.
@pboling
Copy link

pboling commented Aug 13, 2018

I am having this issue on RubyGems 2.7.7 and bundler 1.16.3. I initially reported to Rubygems, but I think the issue is in bundler.
rubygems/rubygems#2377

mlinksva added a commit to github/choosealicense.com that referenced this issue Aug 20, 2018
thehenster added a commit to guidance-guarantee-programme/location-register that referenced this issue Aug 23, 2018
1.16.3 (and apparently 1.16.4 - the latest) seem to be suffering rubygems/bundler#6629
thehenster added a commit to guidance-guarantee-programme/location-register that referenced this issue Aug 23, 2018
1.16.3 (and apparently 1.16.4 - the latest) seem to be suffering rubygems/bundler#6629
AlexWayfer added a commit to AlexWayfer/flame that referenced this issue Aug 23, 2018
AlexWayfer added a commit to AlexWayfer/flame that referenced this issue Aug 23, 2018
@pboling
Copy link

pboling commented Aug 29, 2018

I am still getting the same error on new bundler 1.16.4

@colby-swandale
Copy link
Member

Yes, this problem will continue to exist in new releases of Bundler until we can fix this issue.

bundlerbot added a commit that referenced this issue Sep 13, 2018
…wandale

Fix loadError occurring in nested bundle exec calls

### What was the end-user problem that led to this PR?

There is a LoadError occurring in Bundler when an application has its Gemfile installed with `--path`, and the user has a recent version of RubyGems that installs a version of Bundler as a default gem.

If the user has some code that they're running with `bundle exec` (like a test suite) that is shelling out and executing `bundle exec` again, the user will receive an error saying that Bundler could not be loaded.

    /home/travis/.rvm/gems/ruby-2.5.1/bin/bundle:23:in `load': cannot load such file -- /home/travis/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.16.3/exe/bundle (LoadError)

The problem that's happening is that when we run `bundle exec`, Bundler will set the Ruby environment to add the path of the current version of Bundler into the `LOAD_PATH` and also require `bundler/setup`.

    RUBYOPT=-rbundler/setup
    RUBYLIB=/usr/local/bundle/gems/bundler-1.16.4/lib

This will have Ruby load the lib directory of the version of Bundler the user installed, but it's been loaded with the Gemspec from the default gem version of Bundler that RubyGems installed.

This gemspec is being loaded because RubyGems has a copy of the Bundler gemspec sitting in the default gems. And because we changed `GEM_HOME` when the user ran Bundler with `bundle install --path`, RubyGems just figures that seeing this is only Bundler gemspec it can find, then it should activate it but then `RUBYLIB` comes into play and just overrules RubyGems to load the newer Bundler src.

This is ultimately what's giving us the weird load path that doesn't exist.

![mind blown](https://thumbs.gfycat.com/BlankScarceAfricanporcupine-size_restricted.gif)

### What was your diagnosis of the problem?

See #6537 and #6629

### What is your fix for the problem, implemented in this PR?

When we set the `BUNDLE_BIN_PATH` env var inside bundler, check that the file exists. If it doesn't, we will just set it to the bundle executable file.

### Why did you choose this fix out of the possible options?

This seems to be the solution that patches the LoadError issue without having to heavily refactor code or make the existing code more complicated.
colby-swandale pushed a commit that referenced this issue Sep 13, 2018
…wandale

Fix loadError occurring in nested bundle exec calls

### What was the end-user problem that led to this PR?

There is a LoadError occurring in Bundler when an application has its Gemfile installed with `--path`, and the user has a recent version of RubyGems that installs a version of Bundler as a default gem.

If the user has some code that they're running with `bundle exec` (like a test suite) that is shelling out and executing `bundle exec` again, the user will receive an error saying that Bundler could not be loaded.

    /home/travis/.rvm/gems/ruby-2.5.1/bin/bundle:23:in `load': cannot load such file -- /home/travis/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.16.3/exe/bundle (LoadError)

The problem that's happening is that when we run `bundle exec`, Bundler will set the Ruby environment to add the path of the current version of Bundler into the `LOAD_PATH` and also require `bundler/setup`.

    RUBYOPT=-rbundler/setup
    RUBYLIB=/usr/local/bundle/gems/bundler-1.16.4/lib

This will have Ruby load the lib directory of the version of Bundler the user installed, but it's been loaded with the Gemspec from the default gem version of Bundler that RubyGems installed.

This gemspec is being loaded because RubyGems has a copy of the Bundler gemspec sitting in the default gems. And because we changed `GEM_HOME` when the user ran Bundler with `bundle install --path`, RubyGems just figures that seeing this is only Bundler gemspec it can find, then it should activate it but then `RUBYLIB` comes into play and just overrules RubyGems to load the newer Bundler src.

This is ultimately what's giving us the weird load path that doesn't exist.

![mind blown](https://thumbs.gfycat.com/BlankScarceAfricanporcupine-size_restricted.gif)

### What was your diagnosis of the problem?

See #6537 and #6629

### What is your fix for the problem, implemented in this PR?

When we set the `BUNDLE_BIN_PATH` env var inside bundler, check that the file exists. If it doesn't, we will just set it to the bundle executable file.

### Why did you choose this fix out of the possible options?

This seems to be the solution that patches the LoadError issue without having to heavily refactor code or make the existing code more complicated.

(cherry picked from commit 8c31a61)
colby-swandale pushed a commit that referenced this issue Sep 14, 2018
…wandale

Fix loadError occurring in nested bundle exec calls

### What was the end-user problem that led to this PR?

There is a LoadError occurring in Bundler when an application has its Gemfile installed with `--path`, and the user has a recent version of RubyGems that installs a version of Bundler as a default gem.

If the user has some code that they're running with `bundle exec` (like a test suite) that is shelling out and executing `bundle exec` again, the user will receive an error saying that Bundler could not be loaded.

    /home/travis/.rvm/gems/ruby-2.5.1/bin/bundle:23:in `load': cannot load such file -- /home/travis/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.16.3/exe/bundle (LoadError)

The problem that's happening is that when we run `bundle exec`, Bundler will set the Ruby environment to add the path of the current version of Bundler into the `LOAD_PATH` and also require `bundler/setup`.

    RUBYOPT=-rbundler/setup
    RUBYLIB=/usr/local/bundle/gems/bundler-1.16.4/lib

This will have Ruby load the lib directory of the version of Bundler the user installed, but it's been loaded with the Gemspec from the default gem version of Bundler that RubyGems installed.

This gemspec is being loaded because RubyGems has a copy of the Bundler gemspec sitting in the default gems. And because we changed `GEM_HOME` when the user ran Bundler with `bundle install --path`, RubyGems just figures that seeing this is only Bundler gemspec it can find, then it should activate it but then `RUBYLIB` comes into play and just overrules RubyGems to load the newer Bundler src.

This is ultimately what's giving us the weird load path that doesn't exist.

![mind blown](https://thumbs.gfycat.com/BlankScarceAfricanporcupine-size_restricted.gif)

### What was your diagnosis of the problem?

See #6537 and #6629

### What is your fix for the problem, implemented in this PR?

When we set the `BUNDLE_BIN_PATH` env var inside bundler, check that the file exists. If it doesn't, we will just set it to the bundle executable file.

### Why did you choose this fix out of the possible options?

This seems to be the solution that patches the LoadError issue without having to heavily refactor code or make the existing code more complicated.

(cherry picked from commit 8c31a61)
@colby-swandale
Copy link
Member

This issue has been fixed in the newest release of Bundler.

benoittgt added a commit to benoittgt/rspec-rails that referenced this issue Sep 19, 2018
On bundle 1.16.3 we start seeing fail builds:
- rspec#2013 (comment)

This is related to:
- rspec#2013 (comment)

As mentionned this has been fixed in 1.16.4:
- rubygems/bundler#6629 (comment)
benoittgt added a commit to benoittgt/rspec-rails that referenced this issue Sep 19, 2018
On bundle 1.16.3 we start seeing fail builds:
- rspec#2013 (comment)

This is related to:
- rspec#2013 (comment)

As mentionned this has been fixed in 1.16.4:
- rubygems/bundler#6629 (comment)
DirtyF added a commit to jekyll/jekyll that referenced this issue Sep 19, 2018
benoittgt added a commit to benoittgt/rspec-rails that referenced this issue Sep 20, 2018
On bundle 1.16.3 we start seeing fail builds:
- rspec#2013 (comment)

This is related to:
- rspec#2013 (comment)

As mentionned this has been fixed in 1.16.4:
- rubygems/bundler#6629 (comment)
mlinksva added a commit to github/choosealicense.com that referenced this issue Sep 24, 2018
fetzerch added a commit to fetzerch/fetzerch.github.io that referenced this issue Oct 11, 2018
Upstream ticket (rubygems/bundler#6629) has
been resolved.
sebjacobs pushed a commit to futurelearn/rspec-rails that referenced this issue Mar 15, 2019
See: rubygems/bundler#6629
Should be changed when fixed on next bundler release
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants