On Tue, 26 Apr 2022 at 14:11, Sam Ruby <ru...@intertwingly.net> wrote:
>
> 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?

OK, done.

Also I uninstalled the non-default version of net-smtp.

The sample require script no longer generates warnings.

There are a lot of older versions of Gems around - maybe time to do a cleanup?

> > Sebb
>
> - Sam Ruby

Reply via email to