Skip to content

feat: Support Ruby 4.0#238

Open
sue445 wants to merge 3 commits into
GoogleCloudPlatform:mainfrom
sue445:ruby_4.0
Open

feat: Support Ruby 4.0#238
sue445 wants to merge 3 commits into
GoogleCloudPlatform:mainfrom
sue445:ruby_4.0

Conversation

@sue445

@sue445 sue445 commented Jun 10, 2026

Copy link
Copy Markdown

Currently, the latest version of Ruby is the 4.0 series.

Running the code on Ruby 4.0.x results in the following error:

$ toys ci
/Users/sue445/workspace/github.com/GoogleCloudPlatform/functions-framework-ruby/lib/functions_framework.rb:15: warning: logger used to be loaded from the st
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)
$ 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)

This is caused by logger and ostruct being 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.

sue445 added 3 commits June 11, 2026 00:24
… 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>'
```
@sue445 sue445 changed the title Support Ruby 4.0 feat: Support Ruby 4.0 Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant