Skip to content

Error: undefined method `each' for nil #19142

@pitsianis

Description

@pitsianis

brew doctor output

Your system is ready to brew.

Verification

  • My "brew doctor output" above says Your system is ready to brew. and am still able to reproduce my issue.
  • I ran brew update twice and am still able to reproduce my issue.
  • This issue's title and/or description do not reference a single formula e.g. brew install wget. If they do, open an issue at https://github.com/Homebrew/homebrew-core/issues/new/choose instead.

brew config output

HOMEBREW_VERSION: 4.4.17
ORIGIN: https://github.com/Homebrew/brew
HEAD: 55f399c10dc7e6cc07497bdfccdecc96329e3b57
Last commit: 4 days ago
Branch: stable
Core tap JSON: 23 Jan 21:54 UTC
Core cask tap JSON: 23 Jan 21:54 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_DISPLAY: /private/tmp/com.apple.launchd.UBA4VAnDlk/org.xquartz:0
HOMEBREW_MAKE_JOBS: 12
Homebrew Ruby: 3.3.7 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.7/bin/ruby
CPU: dodeca-core 64-bit arm_blizzard_avalanche
Clang: 16.0.0 build 1600
Git: 2.48.1 => /opt/homebrew/bin/git
Curl: 8.7.1 => /usr/bin/curl
macOS: 15.2-arm64
CLT: 16.2.0.0.1.1733547573
Xcode: N/A
Rosetta 2: false

What were you trying to do (and why)?

I tried to run this command

brew list python | xargs brew uninstall --force

What happened (include all command output)?

> brew list python | xargs brew uninstall --force
Error: undefined method `each' for nil
/opt/homebrew/Library/Homebrew/cask/cask_loader.rb:403:in `block in load'
/opt/homebrew/Library/Homebrew/cask/cask.rb:116:in `instance_eval'
/opt/homebrew/Library/Homebrew/cask/cask.rb:116:in `refresh'
/opt/homebrew/Library/Homebrew/cask/cask.rb:109:in `config='
/opt/homebrew/Library/Homebrew/cask/cask.rb:88:in `initialize'
/opt/homebrew/Library/Homebrew/cask/cask_loader.rb:338:in `new'
/opt/homebrew/Library/Homebrew/cask/cask_loader.rb:338:in `load'
/opt/homebrew/Library/Homebrew/cask/cask_loader.rb:139:in `load'
/opt/homebrew/Library/Homebrew/cask/cask_loader.rb:557:in `load'
/opt/homebrew/Library/Homebrew/cli/named_args.rb:366:in `block in load_formula_or_cask'
/opt/homebrew/Library/Homebrew/api.rb:203:in `with_no_api_env_if_needed'
/opt/homebrew/Library/Homebrew/cli/named_args.rb:320:in `load_formula_or_cask'
/opt/homebrew/Library/Homebrew/cli/named_args.rb:83:in `block in to_formulae_and_casks'
/opt/homebrew/Library/Homebrew/cli/named_args.rb:81:in `each'
/opt/homebrew/Library/Homebrew/cli/named_args.rb:81:in `flat_map'
/opt/homebrew/Library/Homebrew/cli/named_args.rb:81:in `to_formulae_and_casks'
/opt/homebrew/Library/Homebrew/cli/named_args.rb:279:in `to_kegs_to_casks'
/opt/homebrew/Library/Homebrew/cmd/uninstall.rb:44:in `run'
/opt/homebrew/Library/Homebrew/brew.rb:94:in `<main>'
Please report this issue:
  https://docs.brew.sh/Troubleshooting

What did you expect to happen?

I was expecting to remove all python installations

Step-by-step reproduction instructions (by running brew commands)

> brew update
==> Updating Homebrew...
Already up-to-date.
> brew update
==> Updating Homebrew...
Already up-to-date.
nikos@NP-MBPro-M2-3 /u/l/bin> brew doctor
Your system is ready to brew.
> brew list python | xargs brew uninstall --force

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions