Make bundler-checksum work with RubyGems 3.5.6
What does this MR do and why?
RubyGems 3.5.6 dropped Bundler::URI
in favor of a vendored Gem::URI
:
https://github.com/rubygems/rubygems/pull/7386.
As a result, if you attempt to run bundle exec bundler-checksum init
on a system with RubyGems 3.5.6, it will fail:
/Users/stanhu/gdk-ee/gitlab/vendor/gems/bundler-checksum/lib/bundler_checksum/command/init.rb:15:in `execute': undefined method `URI' for Bundler:Module (NoMethodError)
from /Users/stanhu/gdk-ee/gitlab/vendor/gems/bundler-checksum/lib/bundler_checksum/command.rb:17:in `execute'
from /Users/stanhu/gdk-ee/gitlab/vendor/gems/bundler-checksum/bin/bundler-checksum:6:in `<top (required)>'
from /Users/stanhu/.asdf/installs/ruby/3.2.3/lib/ruby/gems/3.2.0/bin/bundler-checksum:25:in `load'
from /Users/stanhu/.asdf/installs/ruby/3.2.3/lib/ruby/gems/3.2.0/bin/bundler-checksum:25:in `<top (required)>'
from /Users/stanhu/.asdf/installs/ruby/3.2.3/lib/ruby/site_ruby/3.2.0/bundler/cli/exec.rb:58:in `load'
from /Users/stanhu/.asdf/installs/ruby/3.2.3/lib/ruby/site_ruby/3.2.0/bundler/cli/exec.rb:58:in `kernel_load'
from /Users/stanhu/.asdf/installs/ruby/3.2.3/lib/ruby/site_ruby/3.2.0/bundler/cli/exec.rb:23:in `run'
from /Users/stanhu/.asdf/installs/ruby/3.2.3/lib/ruby/site_ruby/3.2.0/bundler/cli.rb:451:in `exec'
from /Users/stanhu/.asdf/installs/ruby/3.2.3/lib/ruby/site_ruby/3.2.0/bundler/vendor/thor/lib/thor/command.rb:28:in `run'
from /Users/stanhu/.asdf/installs/ruby/3.2.3/lib/ruby/site_ruby/3.2.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
from /Users/stanhu/.asdf/installs/ruby/3.2.3/lib/ruby/site_ruby/3.2.0/bundler/vendor/thor/lib/thor.rb:527:in `dispatch'
from /Users/stanhu/.asdf/installs/ruby/3.2.3/lib/ruby/site_ruby/3.2.0/bundler/cli.rb:34:in `dispatch'
from /Users/stanhu/.asdf/installs/ruby/3.2.3/lib/ruby/site_ruby/3.2.0/bundler/vendor/thor/lib/thor/base.rb:584:in `start'
from /Users/stanhu/.asdf/installs/ruby/3.2.3/lib/ruby/site_ruby/3.2.0/bundler/cli.rb:28:in `start'
from /Users/stanhu/.asdf/installs/ruby/3.2.3/lib/ruby/gems/3.2.0/gems/bundler-2.5.6/exe/bundle:28:in `block in <top (required)>'
from /Users/stanhu/.asdf/installs/ruby/3.2.3/lib/ruby/site_ruby/3.2.0/bundler/friendly_errors.rb:117:in `with_friendly_errors'
from /Users/stanhu/.asdf/installs/ruby/3.2.3/lib/ruby/gems/3.2.0/gems/bundler-2.5.6/exe/bundle:20:in `<top (required)>'
from /Users/stanhu/.asdf/installs/ruby/3.2.3/bin/bundle:25:in `load'
from /Users/stanhu/.asdf/installs/ruby/3.2.3/bin/bundle:25:in `<main>'
How to set up and validate locally
gem update --system 3.5.5
bundle exec bundler-checksum init
gem update --system
bundle exec bundler-checksum init
Edited by Stan Hu