You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
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.
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)
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?
Activity
eregon commentedon Jul 24, 2025
setup-ruby runs
bundle installand 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 installdoesn'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 installhas an option to list all gems in that Gemfile?If not, we could run
bundle showbut 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.Fryguy commentedon Jul 24, 2025
There used to be a setting, and then they removed it in ruby/rubygems#6804 to never print it. The workaround is to use
--verboseorDEBUG-1env var, but IMO that swings too far in the other direction as that also shows the HTTP traffic.eregon commentedon Jul 24, 2025
I tried
--verbose/DEBUG=1and yeah that looks too messy:bundle showis 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 installflag or env var to print the same asbundle show?In the meanwhile, I agree printing Gemfile.lock in a collapsed section is the best, could you make a PR?
Fryguy commentedon Jul 24, 2025
Will do!
Add printing of the lockfile after installation
Add printing of the lockfile after installation
Add printing of the lockfile after installation
Add printing of the lockfile after installation
Add printing of the lockfile after installation
Add printing of the lockfile after installation