Add gem dependency on logger#1824
Merged
xavdid-stripe merged 2 commits intostripe:masterfrom Mar 23, 2026
Merged
Conversation
stripe is missing a gem dependency on logger. When including stripe in a Gemfile, if logger is not specified directly or included transitively by another gem, this warns in verbose mode on Ruby 3.4, and results in an error on Ruby 4.0. Example file: ``` require 'bundler/inline' gemfile do source 'https://rubygems.org' gem 'stripe' end require "stripe" ``` Running on Ruby 4.0.2: ``` $ ruby -v; ruby t.rb ruby 4.0.2 (2026-03-17 revision d3da9fec82) +PRISM [x86_64-linux] /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/gems/4.0.0/gems/stripe-18.4.2/lib/stripe.rb:7: warning: logger used to be loaded from the standard library, but is not part of the default gems since Ruby 4.0.0. You can add logger to your Gemfile or gemspec to fix this error. /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundler/runtime.rb:71:in 'block (2 levels) in Bundler::Runtime#require': There was an error while trying to load the gem 'stripe'. (Bundler::GemRequireError) Gem Load Error is: cannot load such file -- logger Backtrace for gem load error is: /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundled_gems.rb:60:in 'Kernel.require' /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundled_gems.rb:60:in 'block (2 levels) in Kernel#replace_require' /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/gems/4.0.0/gems/stripe-18.4.2/lib/stripe.rb:7:in '<top (required)>' /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundled_gems.rb:60:in 'Kernel#require' /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundled_gems.rb:60:in 'block (2 levels) in Kernel.replace_require' /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundler/runtime.rb:63:in 'block (2 levels) in Bundler::Runtime#require' /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundler/runtime.rb:58:in 'Array#each' /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundler/runtime.rb:58:in 'block in Bundler::Runtime#require' /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundler/runtime.rb:52:in 'Array#each' /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundler/runtime.rb:52:in 'Bundler::Runtime#require' /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundler/inline.rb:91:in 'block in Object#gemfile' /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundler/settings.rb:143:in 'Bundler::Settings#temporary' /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundler/inline.rb:60:in 'Object#gemfile' t.rb:3:in '<main>' Bundler Error Backtrace: from /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundler/runtime.rb:58:in 'Array#each' from /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundler/runtime.rb:58:in 'block in Bundler::Runtime#require' from /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundler/runtime.rb:52:in 'Array#each' from /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundler/runtime.rb:52:in 'Bundler::Runtime#require' from /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundler/inline.rb:91:in 'block in Object#gemfile' from /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundler/settings.rb:143:in 'Bundler::Settings#temporary' from /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundler/inline.rb:60:in 'Object#gemfile' from t.rb:3:in '<main>' /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundled_gems.rb:60:in 'Kernel.require': cannot load such file -- logger (LoadError) from /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundled_gems.rb:60:in 'block (2 levels) in Kernel#replace_require' from /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/gems/4.0.0/gems/stripe-18.4.2/lib/stripe.rb:7:in '<top (required)>' from /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundled_gems.rb:60:in 'Kernel#require' from /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundled_gems.rb:60:in 'block (2 levels) in Kernel.replace_require' from /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundler/runtime.rb:63:in 'block (2 levels) in Bundler::Runtime#require' from /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundler/runtime.rb:58:in 'Array#each' from /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundler/runtime.rb:58:in 'block in Bundler::Runtime#require' from /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundler/runtime.rb:52:in 'Array#each' from /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundler/runtime.rb:52:in 'Bundler::Runtime#require' from /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundler/inline.rb:91:in 'block in Object#gemfile' from /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundler/settings.rb:143:in 'Bundler::Settings#temporary' from /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundler/inline.rb:60:in 'Object#gemfile' from t.rb:3:in '<main>' ``` This is simple to fix by including logger as a gem dependency.
xavdid-stripe
approved these changes
Mar 23, 2026
Contributor
|
Thank you! we'll enable Ruby 4.0 in our CI soon and hopefully be able to catch stuff like this |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
stripe is missing a gem dependency on logger. When including stripe in a Gemfile, if logger is not specified directly or included transitively by another gem, this warns in verbose mode on Ruby 3.4, and results in an error on Ruby 4.0. Example file:
Running on Ruby 4.0.2:
This is simple to fix by including logger as a gem dependency.