Homebrew / homebrew-bundle

πŸ“¦ Bundler for non-Ruby dependencies from Homebrew, Homebrew Cask and the Mac App Store.
MIT License
5.33k stars 285 forks source link

Error: private method `system' called for module Homebrew #1413

Closed P4sca1 closed 3 months ago

P4sca1 commented 3 months ago

brew config

HOMEBREW_VERSION: 4.3.9-307-g4aae003
ORIGIN: https://github.com/Homebrew/brew
HEAD: 4aae003a1a9caa4a5b22c3c9c23afd6b1ef58a0f
Last commit: 10 hours ago
Core tap JSON: 18 Jul 13:00 UTC
Core cask tap JSON: 18 Jul 13:00 UTC
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 12
HOMEBREW_SORBET_RUNTIME: set
Homebrew Ruby: 3.3.4 => /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/3.3.4/bin/ruby
CPU: dodeca-core 64-bit kabylake
Clang: 15.0.0 build 1500
Git: 2.45.2 => /usr/local/bin/git
Curl: 8.6.0 => /usr/bin/curl
macOS: 14.5-x86_64
CLT: 15.3.0.0.1.1708646388
Xcode: 15.4

Verification

What were you trying to do (and why)?

Installing multiple packages using brew bundle

brew bundle --no-lock --file=/dev/stdin <<EOF
brew "helix"
brew "fzf"
brew "fd"
brew "n"
brew "gh"
brew "jq"
brew "go"
brew "hcloud"
brew "kubectl"
brew "helm"
EOF

What happened (include all command output)?

Error: private method `system' called for module Homebrew
/usr/local/Homebrew/Library/Homebrew/extend/kernel.rb:267:in `safe_system'
/usr/local/Homebrew/Library/Homebrew/brew.rb:139:in `block in <main>'
/usr/local/Homebrew/Library/Homebrew/extend/kernel.rb:530:in `with_env'
/usr/local/Homebrew/Library/Homebrew/brew.rb:128:in `<main>'

What did you expect to happen?

The install should succeed.

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

The issue also occurs when running `brew bundle` without any arguments.
jacobbednarz commented 3 months ago

i'm not able to reproduce this on a fresh install. is there anything else about your local setup that would help diagnose this?

failing this, you may want to try a reinstall of Homebrew in case something has gone astray there.

hyo-choi commented 3 months ago

@P4sca1 Hi! I had a same problem on homebrew version 4.3.9-329-g61f5e2b and when I downgraded homebrew(to 4.3.0), this issue disappeared. I don't know what makes this error but if you need quick workaround, it would work. The way to downgrade homebrew: https://www.phind.com/search?cache=o3chmif13bdstds44r6qqsye

P4sca1 commented 3 months ago

I upgraded homebrew to 4.3.10 and ran brew bundle again. It is now working as expected again. It also automatically downloaded a new version of homebrew-bundle, so I am not sure which update resolved the issue.

johng commented 3 months ago

I see this issue on HEAD, downgrading to 4.3.10 fixes it

MikeMcQuaid commented 3 months ago

@johng I'm on HEAD on both and don't see this on either. Try to run brew update.

johng commented 3 months ago

From a clean brew installation I run into it.

➜  tmp  git clone https://github.com/Homebrew/brew.git brew
➜  tmp ./brew/bin/brew bundle
==> Downloading https://ghcr.io/v2/homebrew/portable-ruby/portable-ruby/blobs/sha256:1e64d7393d6bed090ebd892514457a10a2066682693eaade7d4a25568fa35312
Already downloaded: /Users/jgriffith43/Library/Caches/Homebrew/portable-ruby-3.3.4.arm64_big_sur.bottle.tar.gz
==> Pouring portable-ruby-3.3.4.arm64_big_sur.bottle.tar.gz
Error: private method `system' called for module Homebrew
/Users/jgriffith43/tmp/brew/Library/Homebrew/extend/kernel.rb:267:in `safe_system'
/Users/jgriffith43/tmp/brew/Library/Homebrew/brew.rb:139:in `block in <main>'
/Users/jgriffith43/tmp/brew/Library/Homebrew/extend/kernel.rb:530:in `with_env'
/Users/jgriffith43/tmp/brew/Library/Homebrew/brew.rb:128:in `<main>'
Do not report this issue: you are running in an unsupported configuration.

Also have seen this on our CI and had to pin to 4.3.10

MikeMcQuaid commented 3 months ago

Apologies @johng, still can't reproduce this locally but will try with your instructions when I get a bit.

p-linnane commented 3 months ago

I'm getting an error about curl when I follow @johng's steps:

╰─ ./brew/bin/brew bundle
==> Downloading https://ghcr.io/v2/homebrew/portable-ruby/portable-ruby/blobs/sha256:1e64d7393d6bed090ebd892514457a10a2066682693eaade7d4a25568fa35312
############################################################################################################################################################################################################### 100.0%
==> Pouring portable-ruby-3.3.4.arm64_big_sur.bottle.tar.gz
Error: 'curl' must be installed and in your PATH!
Error: private method `system' called for module Homebrew
/Users/patrick/Downloads/brew/Library/Homebrew/extend/kernel.rb:267:in `safe_system'
/Users/patrick/Downloads/brew/Library/Homebrew/brew.rb:139:in `block in <main>'
/Users/patrick/Downloads/brew/Library/Homebrew/extend/kernel.rb:530:in `with_env'
/Users/patrick/Downloads/brew/Library/Homebrew/brew.rb:128:in `<main>'
Do not report this issue: you are running in an unsupported configuration.
johng commented 3 months ago

Thanks!

On Fri, 26 Jul 2024 at 21:02, Mike McQuaid @.***> wrote:

Closed #1413 https://github.com/Homebrew/homebrew-bundle/issues/1413 as completed via Homebrew/brew#17879 https://github.com/Homebrew/brew/pull/17879.

β€” Reply to this email directly, view it on GitHub https://github.com/Homebrew/homebrew-bundle/issues/1413#event-13664835257, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAUQFJBR5PNE44J3KN5VVO3ZOKML5AVCNFSM6AAAAABLCVCOQSVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJTGY3DIOBTGUZDKNY . You are receiving this because you were mentioned.Message ID: @.***>