On Tue, Apr 26, 2022 at 8:24 AM sebb <seb...@gmail.com> wrote: > > For example: "warning: already initialized constant Net::ProtocRetryError" > > The following Ruby code generates the warning on Whimsy (and in my > Docker build): > > require 'net/http' > require 'net/smtp' > > The same happens if the require order is reversed. > > I wondered why the public json scripts only report the error sometimes. > Turns out that the script only requires 'net/smtp' (via require > 'mail') if there has been a change that needs to be mailed to the > list. > > Whilst the warning is harmless (I think), it can obscure other errors, > so I would like to fix it. > > It looks like removing the net-smtp Gem solves the issue. > When tested in Docker, this does not appear to affect the ability to > send emails, so I propose to make the change in Whimsy -- unless I > hear otherwise?
If you remove the net-smtp gem from the Gemfile, the require will fail with ruby 3.1.2p20. Perhaps add "unless RUBY_VERSION =~ /^2/" to that line in the Gemfile? > Sebb - Sam Ruby