terraform-switcher: Unable to install due to "Invalid formula" error

When I attempt to install tfswitch for the first time I’m getting several “Invalid formula” errors. Here’s the output:

> brew install warrensbox/tap/tfswitch

==> Tapping warrensbox/tap
Cloning into '/usr/local/Homebrew/Library/Taps/warrensbox/homebrew-tap'...
remote: Enumerating objects: 549, done.
remote: Counting objects: 100% (107/107), done.
remote: Compressing objects: 100% (106/106), done.
remote: Total 549 (delta 49), reused 5 (delta 1), pack-reused 442
Receiving objects: 100% (549/549), 69.88 KiB | 2.79 MiB/s, done.
Resolving deltas: 100% (251/251), done.
Error: Invalid formula: /usr/local/Homebrew/Library/Taps/warrensbox/homebrew-tap/Formula/jscheck.rb
jscheck: Calling bottle :unneeded is disabled! There is no replacement.
Please report this issue to the warrensbox/tap tap (not Homebrew/brew or Homebrew/core):
  /usr/local/Homebrew/Library/Taps/warrensbox/homebrew-tap/Formula/jscheck.rb:6

Error: Invalid formula: /usr/local/Homebrew/Library/Taps/warrensbox/homebrew-tap/Formula/hubapp.rb
hubapp: Calling bottle :unneeded is disabled! There is no replacement.
Please report this issue to the warrensbox/tap tap (not Homebrew/brew or Homebrew/core):
  /usr/local/Homebrew/Library/Taps/warrensbox/homebrew-tap/Formula/hubapp.rb:9

Error: Invalid formula: /usr/local/Homebrew/Library/Taps/warrensbox/homebrew-tap/Formula/health-check.rb
health-check: Calling bottle :unneeded is disabled! There is no replacement.
Please report this issue to the warrensbox/tap tap (not Homebrew/brew or Homebrew/core):
  /usr/local/Homebrew/Library/Taps/warrensbox/homebrew-tap/Formula/health-check.rb:9

Error: Cannot tap warrensbox/tap: invalid syntax in tap!

This might be related to Issue #201

My environment:

  • macOS version: 12.2.1
  • brew version: Homebrew 3.3.16-64-g103cd0c

Let me know if you need any further details.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 19
  • Comments: 20 (2 by maintainers)

Most upvoted comments

Experiencing the same problem when installing with brew. It worked with curl

curl -L https://raw.githubusercontent.com/warrensbox/terraform-switcher/release/install.sh | bash

I’m working on fixing this. I should release it today.

@Priyadarshi-Kumar you installed it via tarball (manual install). The issue is with installation via brew (packet manager).

I solved this issue on Macos running on M1 with following commands:

curl -L https://raw.githubusercontent.com/warrensbox/terraform-switcher/release/install.sh -o ./install.sh
chmod +x install.sh sudo ./install.sh

@warrensbox i can reproduce the broken behaviour by running the following

~ ❯ brew uninstall tfswitch
Uninstalling /usr/local/Cellar/tfswitch/0.13.1201... (5 files, 10.0MB)
~ ❯ brew untap warrensbox/tap
Untapping warrensbox/tap...
Untapped 11 formulae (36 files, 107.8KB).
~ ❯ brew install warrensbox/tap/tfswitch
Running `brew update --preinstall`...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> New Formulae
mu-repo
==> Updated Formulae
Updated 2 formulae.

==> Tapping warrensbox/tap
Cloning into '/usr/local/Homebrew/Library/Taps/warrensbox/homebrew-tap'...
remote: Enumerating objects: 549, done.
remote: Counting objects: 100% (107/107), done.
remote: Compressing objects: 100% (106/106), done.
remote: Total 549 (delta 49), reused 5 (delta 1), pack-reused 442
Receiving objects: 100% (549/549), 69.88 KiB | 2.18 MiB/s, done.
Resolving deltas: 100% (251/251), done.
Error: Invalid formula: /usr/local/Homebrew/Library/Taps/warrensbox/homebrew-tap/Formula/jscheck.rb
jscheck: Calling bottle :unneeded is disabled! There is no replacement.
Please report this issue to the warrensbox/tap tap (not Homebrew/brew or Homebrew/core):
  /usr/local/Homebrew/Library/Taps/warrensbox/homebrew-tap/Formula/jscheck.rb:6

Error: Invalid formula: /usr/local/Homebrew/Library/Taps/warrensbox/homebrew-tap/Formula/hubapp.rb
hubapp: Calling bottle :unneeded is disabled! There is no replacement.
Please report this issue to the warrensbox/tap tap (not Homebrew/brew or Homebrew/core):
  /usr/local/Homebrew/Library/Taps/warrensbox/homebrew-tap/Formula/hubapp.rb:9

Error: Invalid formula: /usr/local/Homebrew/Library/Taps/warrensbox/homebrew-tap/Formula/health-check.rb
health-check: Calling bottle :unneeded is disabled! There is no replacement.
Please report this issue to the warrensbox/tap tap (not Homebrew/brew or Homebrew/core):
  /usr/local/Homebrew/Library/Taps/warrensbox/homebrew-tap/Formula/health-check.rb:9

Error: Cannot tap warrensbox/tap: invalid syntax in tap!

The manual installation from the troubleshoot section worked for me

  • Intel Mac (not ARM)
  • MacOS Monterrey 12.2.1 (21D62)
  • Homebrew 3.4.0
  • Homebrew/homebrew-core (git revision 49fa997cd7f; last commit 2022-03-04)
  • Homebrew/homebrew-cask (git revision fe09f6227a; last commit 2022-03-04)
wget https://raw.githubusercontent.com/warrensbox/terraform-switcher/release/install.sh
chmod 755 install.sh
mkdir /usr/local/tfswitch # create installation directory
./install.sh -b /usr/local/tfswitch # install
ln -s /usr/local/tfswitch/tfswitch /usr/local/bin/tfswitch # link in a "common" bin path (same used by Homebrew)
                                                           # alternatively, add /usr/local/tfswitch to $PATH \ 
                                                           # export $PATH=$PATH:/usr/local/tfswitch/
                                                           # as recommended, you should add this to .zshrc
tfswitch # test