google-cloud-ruby: "Key :storage already exists. It will be replaced" warning
I have a rails app that pulls in the storage and error reporting libraries via bundler, like so:
gem 'google-cloud-storage'
gem 'google-cloud-error_reporting'
Under ruby 2.5 on Ubuntu 18.04, I consistently get warnings on every app startup:
Key :storage already exists. It will be replaced. at /home/ops/.gem/ruby/2.5.0/gems/google-cloud-storage-1.13.0/lib/google-cloud-storage.rb:124:in `<top (required)>'
Key :error_reporting already exists. It will be replaced. at /home/ops/.gem/ruby/2.5.0/gems/google-cloud-error_reporting-0.30.1/lib/google-cloud-error_reporting.rb:134:in `<top (required)>'
After tracing this through a bit, it appears that bundler requires the google-cloud-storage gem first, as expect. This internally pulls in google/cloud, which then runs auto_load_gems. This winds up loading google-cloud-storage again (perhaps because the initial require never finished), and we get the duplicate warning.
Is there some way to turn off the auto loading? I’m not sure why it’s being used here, since bundler is managing all gem dependencies.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 18 (10 by maintainers)
Great news! I will submit those changes to be released then.