Skip to content

Commit d84afbb

Browse files
committed
Workaround for cannot load such file -- net/smtp (LoadError)
This commit addresses the Rails Nightly CI failure since: https://buildkite.com/rails/rails-nightly/builds/1694#0194b3e0-213e-441d-b977-8c32f4ed1524 This workaround can be reverted when the newer version of `net-smtp` is released that includes ruby/net-smtp#90 - Steps to reproduce ```ruby cd rails git clone https://github.com/rails/buildkite-config .buildkite/ RUBY_IMAGE=rubylang/ruby:master docker compose -f .buildkite/docker-compose.yml build base && CI=1 docker compose -f .buildkite/docker-compose.yml run default runner actiontext 'rake test' ``` - Actual result without this commit ``` +++ actiontext: rake test /usr/local/bin/ruby -w -I"lib:test" /usr/local/lib/ruby/gems/3.5.0+0/gems/rake-13.2.1/lib/rake/rake_test_loader.rb "test/integration/controller_render_test.rb" "test/integration/job_render_test.rb" "test/integration/mailer_render_test.rb" "test/javascript_package_test.rb" "test/models/table_name_test.rb" "test/template/form_helper_test.rb" "test/unit/attachable_test.rb" "test/unit/attachment_test.rb" "test/unit/content_test.rb" "test/unit/fixture_set_test.rb" "test/unit/model_encryption_test.rb" "test/unit/model_test.rb" "test/unit/plain_text_conversion_test.rb" "test/unit/strict_loading_test.rb" "test/unit/trix_attachment_test.rb" /usr/local/lib/ruby/gems/3.5.0+0/gems/capybara-3.40.0/lib/capybara/session/config.rb:95: warning: URI::RFC3986_PARSER.make_regexp is obsolete. Use URI::RFC2396_PARSER.make_regexp explicitly. /usr/local/lib/ruby/gems/3.5.0+0/bundler/gems/httpclient-d57cc6d5ffee/lib/httpclient/util.rb:71: warning: literal string will be frozen in the future (run with --debug-frozen-string-literal for more information) /usr/local/lib/ruby/3.5.0+0/bundled_gems.rb:76:in 'Kernel.require': cannot load such file -- net/smtp (LoadError) Did you mean? net/sftp from /usr/local/lib/ruby/3.5.0+0/bundled_gems.rb:76:in 'block (2 levels) in Kernel#replace_require' ``` Refer to ruby/net-smtp#90 ruby/ruby#12659
1 parent ce96809 commit d84afbb

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ end
129129
gem "aws-sdk-sns", require: false
130130
gem "webmock"
131131
gem "httpclient", github: "nahi/httpclient", branch: "master", require: false
132+
gem "net-smtp", github: "ruby/net-smtp", ref: "d496a829f9b99adb44ecc1768c4d005e5f7b779e", require: false
132133

133134
# Add your own local bundler stuff.
134135
local_gemfile = File.expand_path(".Gemfile", __dir__)

Gemfile.lock

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@ GIT
1717
rdoc (>= 5.0)
1818
rouge
1919

20+
GIT
21+
remote: https://github.com/ruby/net-smtp.git
22+
revision: d496a829f9b99adb44ecc1768c4d005e5f7b779e
23+
ref: d496a829f9b99adb44ecc1768c4d005e5f7b779e
24+
specs:
25+
net-smtp (0.5.0)
26+
net-protocol
27+
2028
PATH
2129
remote: .
2230
specs:
@@ -396,8 +404,6 @@ GEM
396404
net-ssh (>= 2.6.5, < 8.0.0)
397405
net-sftp (4.0.0)
398406
net-ssh (>= 5.0.0, < 8.0.0)
399-
net-smtp (0.5.0)
400-
net-protocol
401407
net-ssh (7.3.0)
402408
nio4r (2.7.4)
403409
nokogiri (1.18.1)
@@ -703,6 +709,7 @@ DEPENDENCIES
703709
minitest-retry
704710
msgpack (>= 1.7.0)
705711
mysql2 (~> 0.5)
712+
net-smtp!
706713
nokogiri (>= 1.8.1, != 1.11.0)
707714
pg (~> 1.3)
708715
prism

guides/bug_report_templates/action_mailbox.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
# gem "rails", github: "rails/rails", branch: "main"
1111

1212
gem "sqlite3"
13+
gem "net-smtp", github: "ruby/net-smtp", ref: "d496a829f9b99adb44ecc1768c4d005e5f7b779e", require: false
1314
end
1415

1516
require "active_record/railtie"

guides/bug_report_templates/action_mailer.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
gem "rails"
99
# If you want to test against edge Rails replace the previous line with this:
1010
# gem "rails", github: "rails/rails", branch: "main"
11+
gem "net-smtp", github: "ruby/net-smtp", ref: "d496a829f9b99adb44ecc1768c4d005e5f7b779e", require: false
1112
end
1213

1314
require "action_mailer/railtie"

0 commit comments

Comments
 (0)