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
Add net/smtp gem for bug report templates to support Ruby 3.1
#42366
Add net/smtp gem for bug report templates to support Ruby 3.1
#42366
Conversation
|
I saw this failing in the guides build as well, thanks for fixing this @yahonda! Looks like the other guides builds for 3.0 and 2.7 are unhappy though due to |
|
Let me take a look at these failures for Ruby 2.7 and 3.0. https://buildkite.com/rails/rails/builds/77864#a957003c-605f-45e7-a3d8-e02a5a78e23e |
| @@ -9,6 +9,7 @@ | |||
|
|
|||
| gem "rails", github: "rails/rails", branch: "main" | |||
| gem "sqlite3" | |||
| gem "net-smtp" | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yahonda Should this be added to actionmailbox.gemspec?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review. I've found actonmailbox.gemspec already has dependency on mail gem.
rails/actionmailbox/actionmailbox.gemspec
Line 40 in 3c165ad
| s.add_dependency "mail", ">= 2.7.1" |
s.add_dependency "mail", ">= 2.7.1"
Once the newer versions of mail gem which includes this pull request mikel/mail#1439 ,
at least we do not need to add another dependency to net/smtp gem inside of actonmailbox.gemspec .
I prefer to adding dependency inside of each test file by using require 'bundler/inline' like 48f2f1aa078 did for Gemfile. We can remove these dependency once newer verions of mail is released.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we can remove these dependency once newer verions of mail is released, how about adding the mail with head dependency with the note instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah mikel/mail#1439 isn't merged in master yet, nvm.
c6a7930
to
e51a620
Compare
Ruby 3.1 extracts some gems to bundled one, which requires to add these gems to Gemfile explicitly. `net/smtp` is one of them, which affected Action Mailbox bug report templates. * Steps to reproduce Install `ruby 3.1.0dev` ``` git clone https://github.com/rails/rails.git cd rails/guides ruby bug_report_templates/action_mailbox_gem.rb ruby bug_report_templates/action_mailbox_main.rb ``` * This commit addresses the following error `cannot load such file -- net/smtp (LoadError)` ``` $ ruby bug_report_templates/action_mailbox_gem.rb ... snip ... Using rails 6.1.0 /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:332:in `require': cannot load such file -- net/smtp (LoadError) from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:332:in `block in require' from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:299:in `load_dependency' from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:332:in `require' from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/mail-2.7.1/lib/mail.rb:9:in `<module:Mail>' from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/mail-2.7.1/lib/mail.rb:3:in `<top (required)>' from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:332:in `require' from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:332:in `block in require' from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:299:in `load_dependency' from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:332:in `require' from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/actionmailbox-6.1.0/lib/action_mailbox/mail_ext.rb:3:in `<top (required)>' from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:332:in `require' from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:332:in `block in require' from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:299:in `load_dependency' from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:332:in `require' from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/actionmailbox-6.1.0/lib/action_mailbox.rb:3:in `<top (required)>' from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:332:in `require' from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:332:in `block in require' from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:299:in `load_dependency' from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:332:in `require' from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/actionmailbox-6.1.0/lib/action_mailbox/engine.rb:9:in `<top (required)>' from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:332:in `require' from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:332:in `block in require' from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:299:in `load_dependency' from /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/gems/3.1.0/gems/activesupport-6.1.0/lib/active_support/dependencies.rb:332:in `require' from bug_report_templates/action_mailbox_gem.rb:17:in `<main>' ``` * Added comment when this dependency can be removed based on https://bugs.ruby-lang.org/issues/17873 Refer ruby/ruby#4530 rails#42308 Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
e51a620
to
255e3b9
Compare
|
Updated this pull request referring to #42308 . |
…_ruby31 Add `net/smtp` gem for bug report templates to support Ruby 3.1
See the following: * rails/rails#42366 * mikel/mail#1439 * https://bugs.ruby-lang.org/issues/17873 In essence, the net/smtp gem config was changed in ruby 3.1 and the mail gem needs to merge in their fix.
Summary
Ruby 3.1 extracts some gems to bundled one, which requires adding these gems to Gemfile explicitly.
net/smtpis one of them, which affected Action Mailbox bug report templates.Install
ruby 3.1.0devcannot load such file -- net/smtp (LoadError)Refer
https://bugs.ruby-lang.org/issues/17873
ruby/ruby#4530