Skip to content

Running bundle install without cache invokes the wrong version #440

@dblock

Description

@dblock

Ensure the following before filing this issue

  • I verified it reproduces with the latest version with - uses: ruby/setup-ruby@v1 (see Versioning policy)

  • I tried to reproduce the issue locally by following the workflow steps (including all commands done by ruby/setup-ruby, except for Downloading Ruby & Extracting Ruby),
    and it did not reproduce locally (if it does reproduce locally, it's not a ruby/setup-ruby issue)

Are you running on a GitHub-hosted runner or a self-hosted runner?

GitHub-hosted runner

The workflow code or a link to the workflow file

env:
      BUNDLE_GEMFILE: gemfiles/xyz.gemfile
    steps:
      - name: Set up Ruby
        uses: ruby/setup-ruby@v1
        with:
          ruby-version: 2.7
          bundler: 1.3
          bundler-cache: false
      - name: Bundle Install
        run: bundle install

Link to the log of a failed workflow job, or to a gist with the output

https://github.com/mongoid/mongoid-grid_fs/actions/runs/3851022104/jobs/6561793839

The command and output of the failing step

2023-01-05T22:58:48.5434775Z ##[group]Run ruby/setup-ruby@v1
2023-01-05T22:58:48.5435267Z with:
2023-01-05T22:58:48.5435584Z   ruby-version: 2.7
2023-01-05T22:58:48.5435916Z   bundler: 1.17.3
2023-01-05T22:58:48.5436535Z   bundler-cache: false
2023-01-05T22:58:48.5436925Z env:
2023-01-05T22:58:48.5437280Z   BUNDLE_GEMFILE: gemfiles/mongoid-5.0.gemfile
2023-01-05T22:58:48.5437648Z ##[endgroup]
2023-01-05T22:58:49.0015831Z ##[group]Modifying PATH
2023-01-05T22:58:49.0023871Z Entries added to PATH to use selected Ruby:
2023-01-05T22:58:49.0028914Z   /opt/hostedtoolcache/Ruby/2.7.7/x64/bin
2023-01-05T22:58:49.0032710Z ##[endgroup]
2023-01-05T22:58:49.0085952Z ##[group]Downloading Ruby
2023-01-05T22:58:49.0087105Z https://github.com/ruby/ruby-builder/releases/download/toolcache/ruby-2.7.7-ubuntu-22.04.tar.gz
2023-01-05T22:58:49.2916086Z Took   0.28 seconds
2023-01-05T22:58:49.2916900Z ##[endgroup]
2023-01-05T22:58:49.2917701Z ##[group]Extracting  Ruby
2023-01-05T22:58:49.2957419Z [command]/usr/bin/tar -xz -C /opt/hostedtoolcache/Ruby/2.7.7 -f /home/runner/work/_temp/2582c095-29c0-4938-8306-99549f14f10a
2023-01-05T22:58:49.6933307Z Took   0.40 seconds
2023-01-05T22:58:49.6934257Z ##[endgroup]
2023-01-05T22:58:49.6934740Z ##[group]Print Ruby version
2023-01-05T22:58:49.6948632Z [command]/opt/hostedtoolcache/Ruby/2.7.7/x64/bin/ruby --version
2023-01-05T22:58:49.7159731Z ruby 2.7.7p221 (2022-11-24 revision 168ec2b1e5) [x86_64-linux]
2023-01-05T22:58:49.7179262Z Took   0.03 seconds
2023-01-05T22:58:49.7183549Z ##[endgroup]
2023-01-05T22:58:49.7189506Z ##[group]Installing Bundler
2023-01-05T22:58:49.7202362Z [command]/opt/hostedtoolcache/Ruby/2.7.7/x64/bin/gem install bundler -v 1.17.3
2023-01-05T22:58:50.3153955Z Successfully installed bundler-1.17.3
2023-01-05T22:58:50.3155223Z 1 gem installed
2023-01-05T22:58:50.3199889Z Took   0.60 seconds
2023-01-05T22:58:50.3200879Z ##[endgroup]
2023-01-05T22:58:50.3372171Z ##[group]Run bundle install
2023-01-05T22:58:50.3372532Z �[36;1mbundle install�[0m
2023-01-05T22:58:50.3441703Z shell: /usr/bin/bash -e {0}
2023-01-05T22:58:50.3441989Z env:
2023-01-05T22:58:50.3442280Z   BUNDLE_GEMFILE: gemfiles/mongoid-5.0.gemfile
2023-01-05T22:58:50.3442596Z ##[endgroup]
2023-01-05T22:58:52.7565060Z Fetching gem metadata from https://rubygems.org/..........
2023-01-05T22:58:52.9455320Z Fetching gem metadata from https://rubygems.org/.
2023-01-05T22:58:53.1135416Z Resolving dependencies...
2023-01-05T22:58:53.1237167Z Bundler could not find compatible versions for gem "bundler":
2023-01-05T22:58:53.1238228Z   In mongoid-5.0.gemfile:
2023-01-05T22:58:53.1238866Z     rails (~> 4.0) was resolved to 4.2.11.3, which depends on
2023-01-05T22:58:53.1239427Z       bundler (< 2.0, >= 1.3.0)
2023-01-05T22:58:53.1239751Z 
2023-01-05T22:58:53.1240017Z   Current Bundler version:
2023-01-05T22:58:53.1240460Z     bundler (2.1.4)
2023-01-05T22:58:53.1241115Z This Gemfile requires a different version of Bundler.
2023-01-05T22:58:53.1242052Z Perhaps you need to update Bundler by running `gem install bundler`?
2023-01-05T22:58:53.1242555Z 
2023-01-05T22:58:53.1243136Z Could not find gem 'bundler (< 2.0, >= 1.3.0)', which is required by gem 'rails
2023-01-05T22:58:53.1243754Z (~> 4.0)', in any of the sources.
2023-01-05T22:58:53.1244076Z 
2023-01-05T22:58:53.1244416Z Bundler could not find compatible versions for gem "mongoid":
2023-01-05T22:58:53.1244957Z   In mongoid-5.0.gemfile:
2023-01-05T22:58:53.1245455Z     mongoid (~> 5.0.0)
2023-01-05T22:58:53.1245764Z 
2023-01-05T22:58:53.1246233Z     mongoid-grid_fs was resolved to 2.4.1, which depends on
2023-01-05T22:58:53.1246842Z       mongoid (>= 3.0, < 9.0)
2023-01-05T22:58:53.1753230Z ##[error]Process completed with exit code 6.

Any other notes?

When specifying a version of bundler without bundler-cache one must run bundle install. With this setup that invokes another version of bundler.

It's probably not a bug, or possibly a feature request.

  1. What i the right way to invoke bundle install with the version of bundler that was installed?
  2. Is this a feature request of adding install: true/false that would do what bundler-cache: true does minus the cache (run bundle install).
  3. Is this caused by having BUNDLE_GEMFILE? Need to verify.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions