feat: Support Ruby 4.0#238
Open
sue445 wants to merge 3 commits into
Open
Conversation
… Ruby 4.0 ``` $ toys ci /Users/sue445/workspace/github.com/GoogleCloudPlatform/functions-framework-ruby/lib/functions_framework.rb:15: 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. /Users/sue445/.rbenv/versions/4.0.2/lib/ruby/4.0.0/bundled_gems.rb:60:in 'Kernel.require': cannot load such file -- logger (LoadError) from /Users/sue445/.rbenv/versions/4.0.2/lib/ruby/4.0.0/bundled_gems.rb:60:in 'block (2 levels) in Kernel#replace_require' from /Users/sue445/workspace/github.com/GoogleCloudPlatform/functions-framework-ruby/lib/functions_framework.rb:15:in '<top (required)>' from /Users/sue445/.rbenv/versions/4.0.2/lib/ruby/4.0.0/bundled_gems.rb:60:in 'Kernel.require' from /Users/sue445/.rbenv/versions/4.0.2/lib/ruby/4.0.0/bundled_gems.rb:60:in 'block (2 levels) in Kernel#replace_require' from /Users/sue445/workspace/github.com/GoogleCloudPlatform/functions-framework-ruby/test/helper.rb:19:in '<top (required)>' from /Users/sue445/.rbenv/versions/4.0.2/lib/ruby/4.0.0/bundled_gems.rb:60:in 'Kernel.require' from /Users/sue445/.rbenv/versions/4.0.2/lib/ruby/4.0.0/bundled_gems.rb:60:in 'block (2 levels) in Kernel#replace_require' ```
…n Ruby 4.0 ``` $ toys ci test/test_function.rb:16: warning: ostruct used to be loaded from the standard library, but is not part of the default gems since Ruby 4.0.0. You can add ostruct to your Gemfile or gemspec to fix this error. /Users/sue445/.rbenv/versions/4.0.2/lib/ruby/4.0.0/bundled_gems.rb:60:in 'Kernel.require': cannot load such file -- ostruct (LoadError) Did you mean? tsort from /Users/sue445/.rbenv/versions/4.0.2/lib/ruby/4.0.0/bundled_gems.rb:60:in 'block (2 levels) in Kernel#replace_require' from test/test_function.rb:16:in '<top (required)>' from /var/folders/kh/pcns6sf91tnfk6k6b4vqtz8r0000gn/T/toys-minitest-script-20260611-15935-rmwq9y.rb:7:in 'Kernel#load' from /var/folders/kh/pcns6sf91tnfk6k6b4vqtz8r0000gn/T/toys-minitest-script-20260611-15935-rmwq9y.rb:7:in '<main>' ```
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.
Currently, the latest version of Ruby is the 4.0 series.
Running the code on Ruby 4.0.x results in the following error:
This is caused by
loggerandostructbeing promoted from default gems to bundled gems in Ruby 4.0.0.https://www.ruby-lang.org/en/news/2025/12/25/ruby-4-0-0-released/#stdlib-updates
Therefore, I have added these gems as runtime dependencies.