Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning about logger and ostruct in Ruby v3.3.5 #1165

Closed
tmimura39 opened this issue Sep 5, 2024 · 3 comments · Fixed by #1169
Closed

Warning about logger and ostruct in Ruby v3.3.5 #1165

tmimura39 opened this issue Sep 5, 2024 · 3 comments · Fixed by #1169
Assignees
Labels

Comments

@tmimura39
Copy link

Ruby v3.3.5 was recently released.
https://www.ruby-lang.org/en/news/2024/09/03/3-3-5-released/

Warning occurs when loading Rollbar Gem in Ruby v3.3.5

root@6533553801ce:/# cat Gemfile
source "https://rubygems.org"

gem "rollbar"

root@6533553801ce:/# cat main.rb
require "rollbar"

p "RUBY_VERSION #{RUBY_VERSION}"
p "Rollbar::VERSION #{Rollbar::VERSION}"

root@6533553801ce:/# bundle exec ruby main.rb
/usr/local/bundle/gems/rollbar-3.6.0/lib/rollbar.rb:16: warning: logger was loaded from the standard library, but will no longer be part of the default gems starting from Ruby 3.5.0.
You can add logger to your Gemfile or gemspec to silence this warning.
/usr/local/lib/ruby/3.3.0/json/common.rb:3: warning: ostruct was loaded from the standard library, but will no longer be part of the default gems starting from Ruby 3.5.0.
You can add ostruct to your Gemfile or gemspec to silence this warning.
"RUBY_VERSION 3.3.5"
"Rollbar::VERSION 3.6.0"

This warning appears to be in preparation for Ruby v3.5
ruby/ruby#10428
ruby/ruby@d7e558e

You need to add the gem (logger, ostruct) to the rollbar gem's dependencies or stop using the gem in question.

Workaround

Just add them to the Gemfile of each application, as indicated by the warning message

source "https://rubygems.org"

gem "rollbar"
gem "logger"
gem "ostruct"
Copy link

linear bot commented Sep 5, 2024

@zdavis-rollbar zdavis-rollbar added the Ruby label Sep 5, 2024 — with Linear
@waltjones waltjones self-assigned this Sep 9, 2024
@morgoth
Copy link
Contributor

morgoth commented Oct 7, 2024

BTW, I see that Ostruct is not used anywhere in the code so maybe the "require" can be removed? https://github.com/search?q=repo%3Arollbar%2Frollbar-gem%20Ostruct&type=code

@arthurhess
Copy link
Contributor

@morgoth it's used in a couple of specs, but those could be doubles instead of openstructs

.and_return(OpenStruct.new(:code => 500, :body => 'Error'))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants