Brew: Error: Invalid formula: /usr/local/Library/Taps/homebrew/homebrew-core/Formula/disktype.rb

Created on 13 Jul 2016  路  11Comments  路  Source: Homebrew/brew

Please follow the general troubleshooting steps first:

  • [Yes] Ran brew update and retried your prior step?
Anushas-MacBook-Pro:local varun$ brew update
Already up-to-date.
  • [Yes] Ran brew doctor, fixed as many issues as possible and retried your prior step?
Anushas-MacBook-Pro:local varun$ brew doctor
Error: Invalid formula: /usr/local/Library/Taps/homebrew/homebrew-core/Formula/disktype.rb
undefined method `<' for nil:NilClass
Error: Invalid formula: /usr/local/Library/Taps/homebrew/homebrew-core/Formula/expat.rb
undefined method `<' for nil:NilClass
Error: Invalid formula: /usr/local/Library/Taps/homebrew/homebrew-core/Formula/global.rb
undefined method `<' for nil:NilClass
Error: Invalid formula: /usr/local/Library/Taps/homebrew/homebrew-core/Formula/gnuplot.rb
undefined method `<' for nil:NilClass
Error: Invalid formula: /usr/local/Library/Taps/homebrew/homebrew-core/Formula/id3lib.rb
undefined method `<' for nil:NilClass
Error: Invalid formula: /usr/local/Library/Taps/homebrew/homebrew-core/Formula/libowfat.rb
undefined method `<' for nil:NilClass
Error: Invalid formula: /usr/local/Library/Taps/homebrew/homebrew-core/Formula/log4c.rb
undefined method `<' for nil:NilClass
Error: Invalid formula: /usr/local/Library/Taps/homebrew/homebrew-core/Formula/mandoc.rb
undefined method `<' for nil:NilClass
Error: Invalid formula: /usr/local/Library/Taps/homebrew/homebrew-core/Formula/ncp.rb
undefined method `<' for nil:NilClass
Error: Cannot tap homebrew/core: invalid syntax in tap!
Error: Failure while executing: /usr/local/bin/brew tap homebrew/core -q
  • [Yes] If you're seeing permission errors tried running sudo chown -R $(whoami) $(brew --prefix)?
    Done this too, stil the same issue

    Bug reports:

Not able to install anything at all

Anushas-MacBook-Pro:local varun$ brew install git
Error: Invalid formula: /usr/local/Library/Taps/homebrew/homebrew-core/Formula/disktype.rb
undefined method `<' for nil:NilClass
Error: Invalid formula: /usr/local/Library/Taps/homebrew/homebrew-core/Formula/expat.rb
undefined method `<' for nil:NilClass
Error: Invalid formula: /usr/local/Library/Taps/homebrew/homebrew-core/Formula/global.rb
undefined method `<' for nil:NilClass
Error: Invalid formula: /usr/local/Library/Taps/homebrew/homebrew-core/Formula/gnuplot.rb
undefined method `<' for nil:NilClass
Error: Invalid formula: /usr/local/Library/Taps/homebrew/homebrew-core/Formula/id3lib.rb
undefined method `<' for nil:NilClass
Error: Invalid formula: /usr/local/Library/Taps/homebrew/homebrew-core/Formula/libowfat.rb
undefined method `<' for nil:NilClass
Error: Invalid formula: /usr/local/Library/Taps/homebrew/homebrew-core/Formula/log4c.rb
undefined method `<' for nil:NilClass
Error: Invalid formula: /usr/local/Library/Taps/homebrew/homebrew-core/Formula/mandoc.rb
undefined method `<' for nil:NilClass
Error: Invalid formula: /usr/local/Library/Taps/homebrew/homebrew-core/Formula/ncp.rb
undefined method `<' for nil:NilClass
Error: Cannot tap homebrew/core: invalid syntax in tap!
Error: Failure while executing: /usr/local/bin/brew tap homebrew/core -q
Anushas-MacBook-Pro:local varun$
bug

Most helpful comment

Try:

cd /usr/local/Library/Taps/homebrew/homebrew-core && git fetch && git reset --hard origin/master

Note: Will remove any custom changes you've made to formulae in homebrew/core, if you've made any.

All 11 comments

Try:

cd /usr/local/Library/Taps/homebrew/homebrew-core && git fetch && git reset --hard origin/master

Note: Will remove any custom changes you've made to formulae in homebrew/core, if you've made any.

@DomT4 The problem is the user isn't even able to tap that repository, so the path probably doesn't exist. All of the formulae pointed out in the error messages have in common that they have a url with :using => :cvs. Not really sure what is going on, but this smeels like a bug in some recent brew changes to me. Unfortunately, I cannot reproduce the problem locally.

The problem is the user isn't even able to tap that repository, so the path probably doesn't exist.

Oops, I completely forgot Mike's changes around tap readall execution went in the other day. Stupid moment, sorry.

this is the error i am getting now

Anushas-MacBook-Pro:bin varun$ cd /usr/local/Library/Taps/homebrew/homebrew-core && git fetch && git reset --hard origin/master
-bash: cd: /usr/local/Library/Taps/homebrew/homebrew-core: No such file or directory
Anushas-MacBook-Pro:bin varun$ ls -ltr /usr/local/Library/Taps/homebrew
ls: /usr/local/Library/Taps/homebrew: No such file or directory
Anushas-MacBook-Pro:bin varun$ ls -ltr /usr/local/Library/Taps
Anushas-MacBook-Pro:bin varun$

so there is no directory called homebrew in taps

Please paste your brew config output, thanks!

Anushas-MacBook-Pro:bin varun$ brew config
HOMEBREW_VERSION: 0.9.9
ORIGIN: https://github.com/Homebrew/brew
HEAD: ed9bb449d1bfc837d46b2572e9ffc2a70b32f9de
Last commit: 3 days ago
Core tap: N/A
HOMEBREW_PREFIX: /usr/local
HOMEBREW_REPOSITORY: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_BOTTLE_DOMAIN: https://homebrew.bintray.com
CPU: quad-core 64-bit ivybridge
Homebrew Ruby: 1.8.7-p358
Clang: N/A
Git: 1.8.4.2 => /usr/local/git/bin/git
Perl: /usr/bin/perl
Python: /usr/bin/python
Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
Java: 1.6.0_65-b14-462
OS X: 10.7.5-x86_64
Xcode: N/A
CLT: N/A
X11: 2.6.5 => /usr/X11
Anushas-MacBook-Pro:bin varun$

@vnagavarun Thanks, that contained crucial information! I think the bug should be fixed now. Can you brew update, try again installing git, and report back whether this worked?

For those interested: The bug was only affecting macOS prior to 10.9 and only if neither Xcode nor CLT was installed. More details in the commit message of ccb11935f612847145ffe95b3b70f23e621fd4aa. Crucial to understanding was this line in dependency_collector.rb and the fact that CVS-using formulae were affected.

thanks a lot. it works now

TJ-MB033:user techjini$ brew config
HOMEBREW_VERSION: 1.1.6
ORIGIN: https://github.com/Homebrew/brew.git
HEAD: 619791e83d2781dca1b675e20249a8aebe085c7c
Last commit: 3 days ago
Core tap: N/A
HOMEBREW_PREFIX: /usr/local
HOMEBREW_REPOSITORY: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_BOTTLE_DOMAIN: https://homebrew.bintray.com
CPU: quad-core 64-bit broadwell
Homebrew Ruby: 2.0.0-p481
Error: undefined method null?' for nil:NilClass Please report this bug: https://git.io/brew-troubleshooting /usr/local/Library/Homebrew/system_config.rb:146:indump_verbose_config'
/usr/local/Library/Homebrew/extend/os/mac/system_config.rb:42:in dump_verbose_config' /usr/local/Library/Homebrew/cmd/config.rb:12:inconfig'
/usr/local/Library/Homebrew/brew.rb:94:in `

'

Help appreciated.

@roydondsouza Please file a new issue and follow the issue template.

Will do @MikeMcQuaid Thanks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cfredhart picture cfredhart  路  4Comments

paanvaannd picture paanvaannd  路  4Comments

vitahlin picture vitahlin  路  4Comments

stejmurphy picture stejmurphy  路  4Comments

rtobrien picture rtobrien  路  3Comments