Skip to content

Correctly handle bundler 4 being available #827

Description

@Earlopain

On actions that run against ruby-dev, it currently prints the following output (example workflow):

Using Bundler 2 shipped with ruby-head

But ruby-head ships with bundler 4. There is also the following deprecation from bundler:

[DEPRECATED] Using the config command without a subcommand [list, get, set, unset] is deprecated and will be removed in the future. Use bundle config set --local path /home/runner/work/rubocop/rubocop/vendor/bundle instead.

There is a bit of code to handle bundler 1/2 for a variety of different configurations already, so I won't open a PR for this. It's a bit too complicated to really understand what is going on for me

Activity

  1. Petercopter commented on Dec 4, 2025

    @Petercopter

    Bundler 4 was released today and I'm seeing the same message with Ruby 3.4.7

    /opt/hostedtoolcache/Ruby/3.4.7/x64/bin/bundle config --local path /home/runner/work/projectname/projectname/vendor/bundle
    [DEPRECATED] Using the `config` command without a subcommand [list, get, set, unset] is deprecated and will be removed in the future. Use `bundle config set --local path /home/runner/work/projectname/projectname/vendor/bundle` instead.
    
  2. eregon commented on Dec 4, 2025

    @eregon
    Member

    There is a bit of code to handle bundler 1/2 for a variety of different configurations already, so I won't open a PR for this. It's a bit too complicated to really understand what is going on for me

    It's not that complicated IMO, but sure I can take care of that.

  3. eregon commented on Dec 4, 2025

    @eregon
    Member

    Not that simple either, I'll admit, due to numerous Bundler/RubyGems bugs we have to work around and required_ruby_version not working for many Ruby / RubyGems versions:
    #832

  4. added a commit that references this issue on Dec 4, 2025
  5. self-assigned this
    on Dec 4, 2025
  6. eregon commented on Dec 4, 2025

    @eregon
    Member

    Use bundle config set --local path /home/runner/work/rubocop/rubocop/vendor/bundle instead.

    Argh, on Bundler 1 bundle config set --local path foobar results in setting BUNDLE_SET: "--local path foobar" in ~/.bundle/config, so not local and not the correct value :/
    And bundle config --local set path foobar results in setting BUNDLE_SET: "path foobar" in .bundle/config, so local but not correct value.

  7. added a commit that references this issue on Dec 4, 2025
  8. added a commit that references this issue on Dec 5, 2025
  9. Petercopter commented on Dec 5, 2025

    @Petercopter

    👍 @eregon thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions