Homebrew / brew

🍺 The missing package manager for macOS (or Linux)
https://brew.sh
BSD 2-Clause "Simplified" License
40.81k stars 9.58k forks source link

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

Closed vnagavarun closed 8 years ago

vnagavarun commented 8 years ago

Please follow the general troubleshooting steps first:

Anushas-MacBook-Pro:local varun$ brew update
Already up-to-date.
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

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$
DomT4 commented 8 years ago

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.

UniqMartin commented 8 years ago

@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.

DomT4 commented 8 years ago

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.

vnagavarun commented 8 years ago

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

MikeMcQuaid commented 8 years ago

Please paste your brew config output, thanks!

vnagavarun commented 8 years ago

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$

UniqMartin commented 8 years ago

@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.

vnagavarun commented 8 years ago

thanks a lot. it works now

roydondsouza commented 7 years ago

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.

MikeMcQuaid commented 7 years ago

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

roydondsouza commented 7 years ago

Will do @MikeMcQuaid Thanks.