Skip to content
  • Yasuo Honda's avatar
    d84afbb1
    Workaround for `cannot load such file -- net/smtp (LoadError)` · d84afbb1
    Yasuo Honda authored
    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 https://github.com/ruby/net-smtp/pull/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 https://github.com/ruby/net-smtp/pull/90
    https://github.com/ruby/ruby/pull/12659
    d84afbb1
    Workaround for `cannot load such file -- net/smtp (LoadError)`
    Yasuo Honda authored
    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 https://github.com/ruby/net-smtp/pull/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 https://github.com/ruby/net-smtp/pull/90
    https://github.com/ruby/ruby/pull/12659
Loading