Skip to content
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

does not work with rails 7 #59

Closed
800a7b32 opened this issue Dec 19, 2021 · 13 comments
Closed

does not work with rails 7 #59

800a7b32 opened this issue Dec 19, 2021 · 13 comments

Comments

@800a7b32
Copy link

800a7b32 commented Dec 19, 2021

Error:[rake --tasks] rake aborted!
NameError: undefined method `extract_handler_and_format_and_variant' for class `ActionView::OptimizedFileSystemResolver'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/maildown-3.3.0/lib/maildown/ext/action_view.rb:7:in `<class:OptimizedFileSystemResolver>'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/maildown-3.3.0/lib/maildown/ext/action_view.rb:6:in `<module:ActionView>'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/maildown-3.3.0/lib/maildown/ext/action_view.rb:5:in `<main>'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.3/lib/bootsnap/load_path_cache/loaded_features_index.rb:100:in `register'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/zeitwerk-2.5.1/lib/zeitwerk/kernel.rb:35:in `require'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/maildown-3.3.0/lib/maildown.rb:24:in `block in <main>'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/activesupport-7.0.0/lib/active_support/lazy_load_hooks.rb:71:in `class_eval'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/activesupport-7.0.0/lib/active_support/lazy_load_hooks.rb:71:in `block in execute_hook'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/activesupport-7.0.0/lib/active_support/lazy_load_hooks.rb:61:in `with_execution_control'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/activesupport-7.0.0/lib/active_support/lazy_load_hooks.rb:66:in `execute_hook'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/activesupport-7.0.0/lib/active_support/lazy_load_hooks.rb:52:in `block in run_load_hooks'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/activesupport-7.0.0/lib/active_support/lazy_load_hooks.rb:51:in `each'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/activesupport-7.0.0/lib/active_support/lazy_load_hooks.rb:51:in `run_load_hooks'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/actionview-7.0.0/lib/action_view/base.rb:276:in `<class:Base>'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/actionview-7.0.0/lib/action_view/base.rb:141:in `<module:ActionView>'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/actionview-7.0.0/lib/action_view/base.rb:12:in `<main>'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.3/lib/bootsnap/load_path_cache/loaded_features_index.rb:100:in `register'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/zeitwerk-2.5.1/lib/zeitwerk/kernel.rb:35:in `require'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/will_paginate-3.3.1/lib/will_paginate/view_helpers/action_view.rb:149:in `<module:ActionView>'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/will_paginate-3.3.1/lib/will_paginate/view_helpers/action_view.rb:23:in `<module:WillPaginate>'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/will_paginate-3.3.1/lib/will_paginate/view_helpers/action_view.rb:4:in `<main>'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.3/lib/bootsnap/load_path_cache/loaded_features_index.rb:100:in `register'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/zeitwerk-2.5.1/lib/zeitwerk/kernel.rb:35:in `require'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/simple_discussion-1.3.0/lib/simple_discussion/will_paginate.rb:1:in `<main>'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.3/lib/bootsnap/load_path_cache/loaded_features_index.rb:100:in `register'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/zeitwerk-2.5.1/lib/zeitwerk/kernel.rb:35:in `require'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/simple_discussion-1.3.0/lib/simple_discussion.rb:9:in `<main>'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.3/lib/bootsnap/load_path_cache/loaded_features_index.rb:100:in `register'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/zeitwerk-2.5.1/lib/zeitwerk/kernel.rb:35:in `require'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bundler-2.2.33/lib/bundler/runtime.rb:60:in `block (2 levels) in require'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bundler-2.2.33/lib/bundler/runtime.rb:55:in `each'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bundler-2.2.33/lib/bundler/runtime.rb:55:in `block in require'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bundler-2.2.33/lib/bundler/runtime.rb:44:in `each'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bundler-2.2.33/lib/bundler/runtime.rb:44:in `require'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bundler-2.2.33/lib/bundler.rb:175:in `require'
/home/maildown_test/Documents/webapps/my-app/config/application.rb:7:in `<top (required)>'
/home/maildown_test/Documents/webapps/my-app/Rakefile:4:in `require_relative'
/home/maildown_test/Documents/webapps/my-app/Rakefile:4:in `<top (required)>'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/rake_module.rb:29:in `load'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/rake_module.rb:29:in `load_rakefile'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:710:in `raw_load_rakefile'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:104:in `block in load_rakefile'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:186:in `standard_exception_handling'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:103:in `load_rakefile'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:82:in `block in run'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:186:in `standard_exception_handling'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:80:in `run'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/home/maildown_test/.rbenv/versions/3.0.2/bin/rake:23:in `load'
/home/maildown_test/.rbenv/versions/3.0.2/bin/rake:23:in `<top (required)>'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bundler-2.2.33/lib/bundler/cli/exec.rb:58:in `load'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bundler-2.2.33/lib/bundler/cli/exec.rb:58:in `kernel_load'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bundler-2.2.33/lib/bundler/cli/exec.rb:23:in `run'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bundler-2.2.33/lib/bundler/cli.rb:479:in `exec'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bundler-2.2.33/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bundler-2.2.33/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bundler-2.2.33/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bundler-2.2.33/lib/bundler/cli.rb:31:in `dispatch'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bundler-2.2.33/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bundler-2.2.33/lib/bundler/cli.rb:25:in `start'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bundler-2.2.33/exe/bundle:49:in `block in <top (required)>'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bundler-2.2.33/lib/bundler/friendly_errors.rb:103:in `with_friendly_errors'
/home/maildown_test/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bundler-2.2.33/exe/bundle:37:in `<top (required)>'
/home/maildown_test/Documents/webapps/my-app/bin/bundle:3:in `load'
/home/maildown_test/Documents/webapps/my-app/bin/bundle:3:in `<main>'
@raykin
Copy link

raykin commented Dec 22, 2021

I researched Rails source code for a while and found OptimizedFileSystemResolver has totally removed. It maybe replaced with https://github.com/rails/rails/blob/2daef106afc37f385867a5543b06e7b8f2fb908e/actionview/lib/action_view/template/resolver.rb and nodoc at all. Rails upgrade guide doesn't mention it as well cause it's an inner refactor.

@schneems
Copy link
Member

schneems commented Jan 3, 2022

Thanks for the issue. Do you have a small example app that reproduces the issue? https://codetriage.com/example_app

@maxwell
Copy link

maxwell commented Jan 5, 2022

Thanks for the response.

After making the test app with a clean Rails 7 app, there was no issue. However, once I added the "render_async" gem, the error starts to get thrown, claiming to be a maildown issue.

https://github.com/maxwell/maildown-example

I'll look into render_async to see why that might be causing the issue.

@800a7b32 or @raykin are either of you using this gem?

@maxwell
Copy link

maxwell commented Jan 5, 2022

I'm not quite sure what might be the issue here, but the render_async gem does include a new module into action_view.

https://github.com/renderedtext/render_async/blob/master/lib/render_async.rb

Is it possible it is some sort of sad load order issue, combined with the monkeypatch from maildown?

@800a7b32
Copy link
Author

@maxwell I get a similar issue. On a clean rails 7 app (rails new) there are no issues, however when there are other gems present (including render_async as per your sample app), it errors out pointing at maildown.

@raykin
Copy link

raykin commented Jan 17, 2022

@maxwell No. I don't use gem render_async at all. btw I postpone Rails upgrade.

@adamlogic
Copy link

I created a sample app reproducing the issue here. I did not have to add any gems beyond maildown to reproduce it.

As @raykin pointed out, OptimizedFileSystemResolver was removed from Rails in this commit. Prior to that, extract_handler_and_format_and_variant was removed in this commit.

The sample repo includes a patch that's working well for me.

The maildown tests are also failing for me when I run them locally. Here's a snippet of output:

Error:
ExtActionMailerTest#test_monkeypatch_location:
NameError: undefined method `extract_handler_and_format_and_variant' for class `ActionView::OptimizedFileSystemResolver'
    /Users/adam/src/maildown/test/unit/ext_action_mailer_test.rb:10:in `instance_method'
    /Users/adam/src/maildown/test/unit/ext_action_mailer_test.rb:10:in `block in <class:ExtActionMailerTest>'
    minitest (5.15.0) lib/minitest/test.rb:98:in `block (3 levels) in run'
    minitest (5.15.0) lib/minitest/test.rb:195:in `capture_exceptions'

I'm guessing this means the tests are dependent upon whatever version of Rails happens to be installed. I'm not really sure how best to make this work with multiple versions of Rails.

@armilam
Copy link

armilam commented Feb 25, 2022

@adamlogic that patch is also working for me. Do you feel it's good enough to submit a PR?

@adamlogic
Copy link

I'm not sure. Making this gem work with multiple versions of Rails is complicated, and I haven't thought through the implications of my patch beyond my own Rails 7 app.

@schneems
Copy link
Member

If you want to turn this into a patch that fixes Rails 7 then I can do the leg work of getting older versions to work on the gem.

Im also wishing/wondering if maybe there’s a more bulletproof way to get what we want. Like maybe we hook into sprockets and generate the html/plaintext assets at deploy time (or something). The way this gem works is fundamentally opposed to a core concept with Rails (that mime types and outputs are 1:1 correlated with files on disk).

We are able to hack it via monkey patches but ideally for this to be sustainable into the future we either need to do something different or get Rails to provide a public “blessed” way to hook into its rendering pipeline to generate two different outputs from one input file.

let’s get rails 7 working for now and then maybe revisit longer term maintainability.

@raykin
Copy link

raykin commented Mar 9, 2022

@adamlogic I tried your patch, it did work in development but at last failed on production when deploying to Heroku. The crash raised before app start and said

superclass mismatch for class OptimizedFileSystemResolver (TypeError)

After hours of debugging, I get a new solution to just satisfy OptimizedFileSystemResolver in maildown.

module ActionView
  # No required for Rails7
  class OptimizedFileSystemResolver
    def extract_handler_and_format_and_variant(template)
      # just set it for outdated maildown
    end
  end
end

@schneems This gem actually works well with Rails7 without OptimizedFileSystemResolver. I also add a new case in my project to verify it works.

    ## prepare email
    assert_equal 2, email.parts.size
    assert_equal "multipart/mixed", email.mime_type
    assert_equal "text/plain", email.text_part.mime_type
    assert_match er.content, email.text_part.body.to_s
    assert_equal "text/html", email.html_part.mime_type

Just a little change, multipart/alternative becomes multipart/mixed

This was referenced Jul 31, 2022
schneems added a commit that referenced this issue Jul 31, 2022
Documented in #59. This class was removed from Rails 7. 

This causes an error on this line when trying to alias a method that does not exist https://github.com/zombocom/maildown/blob/cbf5b51e0867eab1ec945d38b5335f42139b0322/lib/maildown/ext/action_view.rb#L7.

The solution presented was to re-add the method. However simply doing this with a `defined?(OptimizedFileSystemResolver)` causes a load via zeitwork and also results in a crash.

The presence of this code appears to do nothing in Rails 7. It's basically a no-op that allows us to boot without erroring.
schneems added a commit that referenced this issue Jul 31, 2022
Documented in #59. This class was removed from Rails 7. 

This causes an error on this line when trying to alias a method that does not exist https://github.com/zombocom/maildown/blob/cbf5b51e0867eab1ec945d38b5335f42139b0322/lib/maildown/ext/action_view.rb#L7.

The solution presented was to re-add the method. However simply doing this with a `defined?(OptimizedFileSystemResolver)` causes a load via zeitwork and also results in a crash.

The presence of this code appears to do nothing in Rails 7. It's basically a no-op that allows us to boot without erroring.
schneems added a commit that referenced this issue Jul 31, 2022
Documented in #59. This class was removed from Rails 7. 

This causes an error on this line when trying to alias a method that does not exist https://github.com/zombocom/maildown/blob/cbf5b51e0867eab1ec945d38b5335f42139b0322/lib/maildown/ext/action_view.rb#L7.

The solution presented was to re-add the method. However simply doing this with a `defined?(OptimizedFileSystemResolver)` causes a load via zeitwork and also results in a crash.

The presence of this code appears to do nothing in Rails 7. It's basically a no-op that allows us to boot without erroring.
schneems added a commit that referenced this issue Jul 31, 2022
Documented in #59. This class was removed from Rails 7.

This causes an error on this line when trying to alias a method that does not exist https://github.com/zombocom/maildown/blob/cbf5b51e0867eab1ec945d38b5335f42139b0322/lib/maildown/ext/action_view.rb#L7.

The solution presented was to re-add the method. However simply doing this with a `defined?(OptimizedFileSystemResolver)` causes a load via zeitwork and also results in a crash.

The presence of this code appears to do nothing in Rails 7. It's basically a no-op that allows us to boot without erroring.
schneems added a commit that referenced this issue Jul 31, 2022
* Update maintenance policy and dummy gemfiles

* Update check changelog

* First Github CI commit

* Fix missing net/smtp error

```
Error:
LayoutsTest#test_no_layout:
LoadError: cannot load such file -- net/smtp
    activesupport (6.1.6) lib/active_support/dependencies.rb:332:in `require'
    activesupport (6.1.6) lib/active_support/dependencies.rb:332:in `block in require'
    activesupport (6.1.6) lib/active_support/dependencies.rb:299:in `load_dependency'
    activesupport (6.1.6) lib/active_support/dependencies.rb:332:in `require'
    mail (2.7.1) lib/mail.rb:9:in `<module:Mail>'
```

https://stackoverflow.com/questions/70500220/rails-7-ruby-3-1-loaderror-cannot-load-such-file-net-smtp

* Patch for Rails 7

Documented in #59. This class was removed from Rails 7.

This causes an error on this line when trying to alias a method that does not exist https://github.com/zombocom/maildown/blob/cbf5b51e0867eab1ec945d38b5335f42139b0322/lib/maildown/ext/action_view.rb#L7.

The solution presented was to re-add the method. However simply doing this with a `defined?(OptimizedFileSystemResolver)` causes a load via zeitwork and also results in a crash.

The presence of this code appears to do nothing in Rails 7. It's basically a no-op that allows us to boot without erroring.
@schneems
Copy link
Member

Fixed in #61. I'm about to cut a release. Also I'm looking for maintenance help #62

@schneems
Copy link
Member

Also, thanks a ton for the reproduction and the discussion. Once I finally got Rails 7 tests working on GitHub actions it made it much easier to patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants