Skip to content

NoMethodError: undefined method 'none?' for WebConsole::Permissions with Rails 8.2 edge #346

@sschuez

Description

@sschuez

Description

After updating to Rails edge (main branch as of Feb 18, 2026), web-console 4.2.1 crashes on every request with:

NoMethodError: undefined method 'none?' for an instance of WebConsole::Permissions
from actionpack/lib/action_dispatch/middleware/remote_ip.rb:203:in 'block in ActionDispatch::RemoteIp::GetIp#first_non_proxy'

Cause

Rails PR #56805 ("Optimize calculating remote IP address") changed the RemoteIp middleware to call @proxies.none?
instead of using reject:

# New code in first_non_proxy:
@proxies.none? do |proxy|
  # ...
end

WebConsole::Permissions is passed as the proxies list via config.web_console.allowed_ips, but it only implements include? — not none? or other Enumerable methods.

Suggested Fix

Make Permissions include Enumerable and delegate iteration to @networks:

  module WebConsole
    class Permissions
      include Enumerable

      def each(&block)
        @networks.each(&block)
      end

      # ... existing code
    end
  end

Environment

  • Rails: 8.2.0.alpha (main branch, commit 752cc39 or later)
  • web-console: 4.2.1
  • Ruby: 3.4.x

Workaround

Add an initializer to patch the class:

  # config/initializers/web_console_patch.rb
  if defined?(WebConsole::Permissions)
    module WebConsole
      class Permissions
        include Enumerable

        def each(&block)
          @networks.each(&block)
        end
      end
    end
  end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions