nested bundle exec, not working in Ruby trunk/head #7244
Comments
I tried this on current master and it seems to work, so this should probably be fixed once a newer bundler commit is used in ruby-core. I did this on current master, not sure if it fully represents the case you're seeing:
|
Fixed in ruby/ruby#2285 |
You have to use Ruby trunk/master/2.7.0. Explanation in the above Ruby PR... |
You don't make PRs to ruby-core for bundler. You make PRs to the bundler repo, and then they are backported to ruby. Currently the ruby repo is using an older reference than current bundler's master, and the issue you mention is not reproducible on bundler's master. Once ruby-core is updated to the latest bundler, the issue should be fixed since I can't reproduce it here. |
Thanks. I saw your previous response, and assumed you hadn't read the PR. Yes and yes. I'm not sure if I'm kind of sensitive about trunk failures... |
Actually, the failure is a result of bundler being installed as a default gem, so that really isn't a 'Ruby core' issue, it's just that core/trunk is the only place that happens. I don't know what exactly the 'integration plans' are, but if RG and Bundler will be separate default gems as they are in trunk... Regardless, this breaks trunk CI, and considering that a few times when I've suggested that repos test against it, they complain about failures, issues like this should get fixed in a prompt manner, regardless of upstream, downstream, or a body of water. Lastly, I have no idea how to write a test for this, as the failure happens when the bundler exe folder is in its installed location... |
7248: Fix nested bundle exec's when bundler is a default gem r=deivid-rodriguez a=MSP-Greg ### What was the end-user problem that led to this PR? The problem was that when bundler is a default gem, nested `bundle exec` commands generate a LoadError. ``` /home/travis/.rvm/rubies/ruby-head/bin/bundle:30:in `load': cannot load such file -- /home/travis/.rvm/rubies/ruby-head/lib/bin/bundle (LoadError) ``` ### What was your diagnosis of the problem? Not accounting for Bundler being installed as a default gem. When it's a default, the lib and exe folders do not share the same root folder. This was the result of a change in e742c3d (#7100). ### Repo Example Using Ruby master/trunk/ruby-head (as of ruby/ruby@0c6c937), from a folder where `bundle exec` can be ran: ``` bundle exec "bundle exec 'ruby -v'" ``` ### What is your fix for the problem, implemented in this PR? Small adjustment to logic for finding the correct exe/bundle file. ### Why did you choose this fix out of the possible options? I chose this fix because it's similar to previous code. Fixes #7244. Co-authored-by: MSP-Greg <msp-greg@users.noreply.github.com>
Only on Ruby trunk/head, there's a Travis CI test issue with Puma that generates a
LoadError
, where abundle exec
command is generated within a process started viabundle exec
.So, I used the following command:
Works fine with Ruby 2.6.3, RG 3.0.3, & bundler 2.0.1.
With Ruby trunk/master/head/2.7.0 (RG 3.1.0.pre1, bundler 2.1.0.pre.1), it fails on the line in the bin stub:
Correct value is:
nested value is the following, which doesn't exist, and generates the LoadError:
EDIT:
Sorry for not making it explicitly clear, but
bundle exec "ruby -v"
works fine in both. The only issue is nestedbundle exec
's, which may be common in testing started with 'bundle exec rake <test>`...The text was updated successfully, but these errors were encountered: