Skip to content

Cannot install formulas using --formula -s <file.rb> #20521

@ychin

Description

@ychin

brew doctor output

Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: Some installed casks are deprecated or disabled.
You should find replacements for the following casks:
  goneovim

Warning: Some installed kegs have no formulae!
This means they were either deleted or installed manually.
You should find replacements for the following formulae:
  perl@5.18

Warning: Some installed formulae are deprecated or disabled.
You should find replacements for the following formulae:
  autoconf@2.69
  openssl@1.1
  perl@5.18
  python@3.8

Warning: You have unlinked kegs in your Cellar.
Leaving kegs unlinked can lead to build-trouble and cause formulae that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
  macvim
  python@3.8

Verification

  • I ran brew update twice and am still able to reproduce my issue.
  • My "brew doctor output" above says Your system is ready to brew or a definitely unrelated Tier message.
  • 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.6.4-87-g0331386-dirty
ORIGIN: https://github.com/Homebrew/brew
HEAD: 033138638f07fb51a0a3bc21151d9b956b9054a3
Last commit: 6 hours ago
Branch: main
Core tap JSON: 20 Aug 00:21 UTC
Core cask tap JSON: 20 Aug 00:17 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_DISPLAY: /private/tmp/com.apple.launchd.NMnEw3SHZQ/org.macosforge.xquartz:0
HOMEBREW_FORBID_PACKAGES_FROM_PATHS: set
HOMEBREW_MAKE_JOBS: 10
HOMEBREW_SORBET_RUNTIME: set
Homebrew Ruby: 3.4.5 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.4.5/bin/ruby
CPU: deca-core 64-bit arm_firestorm_icestorm
Clang: 17.0.0 build 1700
Git: 2.51.0 => /opt/homebrew/bin/git
Curl: 8.7.1 => /usr/bin/curl
macOS: 15.6-arm64
CLT: 16.4.0.0.1.1747106510
Xcode: 16.4
Rosetta 2: false

What were you trying to do (and why)?

I want to install a formula by manually using a .rb file. This has worked before and it now pops up an error message.

What happened (include all command output)?

$ brew install --formula -s ./gettext.rb
Error: Homebrew requires formulae to be in a tap, rejecting:
  ./gettext.rb (/Users/ychin/Dev/macvim/gettext.rb)

To create a tap, run e.g.
  brew tap-new <user|org>/<repository>
To create a formula in a tap run e.g.
  brew create <url> --tap=<user|org>/<repository>

What did you expect to happen?

Homebrew should build gettext from source given the .rb file. This has worked before and there seems to be a backwards incompatible flag HOMEBREW_FORBID_PACKAGES_FROM_PATHS that seemed to be added. I tried manually setting that flag to 0 and it didn't work as well, so maybe it's something else.

I looked at https://github.com/orgs/Homebrew/discussions/6351 but it seems to be referring to something else, and the "fix" according to that thread (#20507) is already in my Homebrew installation.

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

brew cat gettext > gettext.rb
brew install --formula -s ./gettext.rb

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions