1

在 mimemagic 惨败之后,我最近将 Rails 6.0.3.5 应用程序升级到 6.1.3。

现在,我看到渲染视图后发生的这个有趣的问题,这很奇怪。我该如何调试?该应用程序使用 Ruby 2.7.1

这是完整的堆栈跟踪

[31a95c67-7597-4856-9dfc-e813bb0d760a]   Rendered layout layouts/application.html.erb (Duration: 5001.5ms | Allocations: 119937)
[31a95c67-7597-4856-9dfc-e813bb0d760a] Completed 200 OK in 5572ms (Views: 5005.9ms | ActiveRecord: 23.5ms | Allocations: 196152)
[31a95c67-7597-4856-9dfc-e813bb0d760a]
ArgumentError: wrong number of arguments (given 2, expected 3)
    from /Users/aurs/.rvm/gems/ruby-2.7.1/gems/actionview-6.1.3.1/lib/action_view/base.rb:230:in `initialize'
    from /Users/aurs/.rvm/gems/ruby-2.7.1/gems/web-console-3.7.0/lib/web_console/template.rb:21:in `new'
    from /Users/aurs/.rvm/gems/ruby-2.7.1/gems/web-console-3.7.0/lib/web_console/template.rb:21:in `render'
    from /Users/aurs/.rvm/gems/ruby-2.7.1/gems/web-console-3.7.0/lib/web_console/middleware.rb:37:in `block in call'
    from /Users/aurs/.rvm/gems/ruby-2.7.1/gems/web-console-3.7.0/lib/web_console/middleware.rb:20:in `catch'
    from /Users/aurs/.rvm/gems/ruby-2.7.1/gems/web-console-3.7.0/lib/web_console/middleware.rb:20:in `call'
    from /Users/aurs/.rvm/gems/ruby-2.7.1/gems/actionpack-6.1.3.1/lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
    from /Users/aurs/.rvm/gems/ruby-2.7.1/gems/railties-6.1.3.1/lib/rails/rack/logger.rb:37:in `call_app'
    from /Users/aurs/.rvm/gems/ruby-2.7.1/gems/railties-6.1.3.1/lib/rails/rack/logger.rb:26:in `block in call'
    from /Users/aurs/.rvm/gems/ruby-2.7.1/gems/activesupport-6.1.3.1/lib/active_support/tagged_logging.rb:99:in `block in tagged'
    from /Users/aurs/.rvm/gems/ruby-2.7.1/gems/activesupport-6.1.3.1/lib/active_support/tagged_logging.rb:37:in `tagged'
    from /Users/aurs/.rvm/gems/ruby-2.7.1/gems/activesupport-6.1.3.1/lib/active_support/tagged_logging.rb:99:in `tagged'
    from /Users/aurs/.rvm/gems/ruby-2.7.1/gems/railties-6.1.3.1/lib/rails/rack/logger.rb:26:in `call'
    from /Users/aurs/.rvm/gems/ruby-2.7.1/gems/actionpack-6.1.3.1/lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
    from /Users/aurs/.rvm/gems/ruby-2.7.1/gems/actionpack-6.1.3.1/lib/action_dispatch/middleware/request_id.rb:26:in `call'
    from /Users/aurs/.rvm/gems/ruby-2.7.1/gems/rack-2.2.3/lib/rack/method_override.rb:24:in `call'
    from /Users/aurs/.rvm/gems/ruby-2.7.1/gems/rack-2.2.3/lib/rack/runtime.rb:22:in `call'
    from /Users/aurs/.rvm/gems/ruby-2.7.1/gems/activesupport-6.1.3.1/lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
    from /Users/aurs/.rvm/gems/ruby-2.7.1/gems/actionpack-6.1.3.1/lib/action_dispatch/middleware/executor.rb:14:in `call'
    from /Users/aurs/.rvm/gems/ruby-2.7.1/gems/actionpack-6.1.3.1/lib/action_dispatch/middleware/static.rb:24:in `call'
    from /Users/aurs/.rvm/gems/ruby-2.7.1/gems/rack-2.2.3/lib/rack/sendfile.rb:110:in `call'
    from /Users/aurs/.rvm/gems/ruby-2.7.1/gems/actionpack-6.1.3.1/lib/action_dispatch/middleware/host_authorization.rb:98:in `call'
    from /Users/aurs/.rvm/gems/ruby-2.7.1/gems/webpacker-5.2.1/lib/webpacker/dev_server_proxy.rb:25:in `perform_request'
    from /Users/aurs/.rvm/gems/ruby-2.7.1/gems/rack-proxy-0.6.5/lib/rack/proxy.rb:57:in `call'
    from /Users/aurs/.rvm/gems/ruby-2.7.1/gems/railties-6.1.3.1/lib/rails/engine.rb:539:in `call'
    from /Users/aurs/.rvm/gems/ruby-2.7.1/gems/puma-5.2.1/lib/puma/configuration.rb:247:in `call'
    from /Users/aurs/.rvm/gems/ruby-2.7.1/gems/puma-5.2.1/lib/puma/request.rb:76:in `block in handle_request'
    from /Users/aurs/.rvm/gems/ruby-2.7.1/gems/puma-5.2.1/lib/puma/thread_pool.rb:337:in `with_force_shutdown'
    from /Users/aurs/.rvm/gems/ruby-2.7.1/gems/puma-5.2.1/lib/puma/request.rb:75:in `handle_request'
    from /Users/aurs/.rvm/gems/ruby-2.7.1/gems/puma-5.2.1/lib/puma/server.rb:431:in `process_client'
    from /Users/aurs/.rvm/gems/ruby-2.7.1/gems/puma-5.2.1/lib/puma/thread_pool.rb:145:in `block in spawn_thread'
4

1 回答 1

5

web-consolegem 与 Rails 6.1 中断,升级到 4.1.0 修复了该错误。

于 2021-04-14T00:10:56.757 回答