GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Print the final content of the Gemfile.lock · Issue #783 · ruby/setup-ruby

Print the final content of the Gemfile.lock #783

New issue
Copy link
New issue
Copy link
Closed
#790
#785
Closed
Print the final content of the Gemfile.lock#783
#790
#785
Copy link

Description

@Fryguy
Fryguy
opened on Jul 24, 2025
Issue body actions

Feature request: Print the final content of the Gemfile.lock.

From a diagnostics point of view, it is very useful to see exactly what versions of gems were installed from run to run.

In our particular case, we had a corrupted cache which caused the list of gems to be rebuilt, and the new run failed our CI. While I could see the newly installed gems as they were installed, when I went to the previous green run, I couldn't see what was installed.

The request is simply, at the end of installation, print the Gemfile.lock into the log in a collapsed section.

I am willing to make a PR for this feature but wanted to discuss first.

Activity

  1. eregon commented on Jul 24, 2025

    @eregon
    eregon
    on Jul 24, 2025
    Member
    More actions

    setup-ruby runs bundle install and that used to print the list of all gems, even if they are already installed:
    https://github.com/ruby/setup-ruby/actions/runs/16427759281/job/46422252372#step:3:33

    It seems bundle install doesn't do this by default anymore for recent Bundler unfortunately:
    https://github.com/ruby/setup-ruby/actions/runs/16427759281/job/46422252395#step:3:40

    Could you find out if bundle install has an option to list all gems in that Gemfile?

    If not, we could run bundle show but that would be slow, or print the Gemfile.lock, which is faster but also quite a bit longer output, and redundant for repositories which check in their Gemfile.lock.

  2. Fryguy commented on Jul 24, 2025

    @Fryguy
    Fryguy
    on Jul 24, 2025
    ContributorAuthor
    More actions

    There used to be a setting, and then they removed it in ruby/rubygems#6804 to never print it. The workaround is to use --verbose or DEBUG-1 env var, but IMO that swings too far in the other direction as that also shows the HTTP traffic.

  3. eregon commented on Jul 24, 2025

    @eregon
    eregon
    on Jul 24, 2025
    Member
    More actions

    I tried --verbose/DEBUG=1 and yeah that looks too messy:

    $ bundle install --verbose
    Running `bundle install --verbose` with bundler 2.6.4
    Found no changes, using resolution from the lockfile
    Using bundler 2.6.4
    0:  bundler (2.6.4) from /home/eregon/.rubies/ruby-3.4.2/lib/ruby/gems/3.4.0/specifications/bundler-2.6.4.gemspec
    Using json 2.2.0
    0:  json (2.2.0) from /home/eregon/tmp/bundler-gemfile/vendor/bundle/ruby/3.4.0/specifications/json-2.2.0.gemspec
    Using path 2.1.0
    0:  path (2.1.0) from /home/eregon/tmp/bundler-gemfile/vendor/bundle/ruby/3.4.0/specifications/path-2.1.0.gemspec
    Bundle complete! 2 Gemfile dependencies, 3 gems now installed.
    Bundled gems are installed into `./vendor/bundle`
    
    $ bundle show
    Gems included by the bundle:
      * bundler (2.6.4)
      * json (2.2.0)
      * path (2.1.0)
    
    $ cat Gemfile.lock 
    GEM
      remote: https://rubygems.org/
      specs:
        json (2.2.0)
        path (2.1.0)
    
    PLATFORMS
      ruby
      x86_64-linux
    
    DEPENDENCIES
      json (= 2.2.0)
      path
    
    BUNDLED WITH
       2.6.4
    

    bundle show is nicest, but I'm concerned it would increase the runtime of every job, especially on non-CRuby and for Gemfile with many gems.
    Maybe you could file a Bundler feature for a bundle install flag or env var to print the same as bundle show?

    In the meanwhile, I agree printing Gemfile.lock in a collapsed section is the best, could you make a PR?

  4. Fryguy commented on Jul 24, 2025

    @Fryguy
    Fryguy
    on Jul 24, 2025
    ContributorAuthor
    More actions

    Will do!

  5. Fryguy
    added 2 commits that reference this issue on Jul 24, 2025

    Add printing of the lockfile after installation

    This issue will close once commit 23ee4ef is merged into the 'master' branch.
    23ee4ef

    Add printing of the lockfile after installation

    This issue will close once commit 0f7db01 is merged into the 'master' branch.
    0f7db01
  6. eregon
    added a commit that references this issue on Jul 25, 2025

    Add printing of the lockfile after installation

    This issue will close once commit 7a77259 is merged into the 'master' branch.
    7a77259
  7. eregon
    closed this as completedin #785on Jul 25, 2025
  8. eregon
    added a commit that references this issue on Jul 25, 2025

    Add printing of the lockfile after installation

    This issue will close once commit e8621f0 is merged into the 'master' branch.
    e8621f0
  9. Fryguy
    added a commit that references this issue on Jul 25, 2025

    Add printing of the lockfile after installation

    This issue will close once commit 6284f69 is merged into the 'master' branch.
    6284f69
  10. eregon
    added a commit that references this issue on Jul 26, 2025

    Add printing of the lockfile after installation

    This issue will close once commit ba9e71c is merged into the 'master' branch.
    ba9e71c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.