Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
vnagavarun opened this issue Jul 13, 2016 · 11 comments
Labels
bug Reproducible Homebrew/brew bug

Comments

@vnagavarun
Copy link

vnagavarun commented Jul 13, 2016

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$
@DomT4
Copy link
Contributor

DomT4 commented Jul 13, 2016

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
Copy link
Contributor

UniqMartin commented Jul 13, 2016

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

@UniqMartin UniqMartin added the bug Reproducible Homebrew/brew bug label Jul 13, 2016
@DomT4
Copy link
Contributor

DomT4 commented Jul 13, 2016

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
Copy link
Author

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
Copy link
Member

Please paste your brew config output, thanks!

@UniqMartin UniqMartin added the needs response Needs a response from the issue/PR author label Jul 14, 2016
@vnagavarun
Copy link
Author

Anushas-MacBook-Pro:bin varun$ brew config
HOMEBREW_VERSION: 0.9.9
ORIGIN: https://github.com/Homebrew/brew
HEAD: ed9bb44
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$

@ghost ghost removed the needs response Needs a response from the issue/PR author label Jul 16, 2016
@UniqMartin
Copy link
Contributor

@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 ccb1193. Crucial to understanding was this line in dependency_collector.rb and the fact that CVS-using formulae were affected.

@vnagavarun
Copy link
Author

thanks a lot. it works now

souvik1997 pushed a commit to souvik1997/brew that referenced this issue Jul 25, 2016
On systems prior to 10.9, formulae that use CVS as a download source
check whether the installed Xcode already provides CVS to avoid adding
a dependency on the `cvs` formula. Unfortunately, if no Xcode is
installed the check fails with

  undefined method `<' for nil:NilClass

causing the formula to become unloadable. This in turn causes some taps
to be untappable since Homebrew#396 added the `readall` check on `tap`.

Closes Homebrew#508.
@roydondsouza
Copy link

roydondsouza commented Jan 6, 2017

TJ-MB033:user techjini$ brew config
HOMEBREW_VERSION: 1.1.6
ORIGIN: https://github.com/Homebrew/brew.git
HEAD: 619791e
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:in dump_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:in config'
/usr/local/Library/Homebrew/brew.rb:94:in `

'

Help appreciated.

@MikeMcQuaid
Copy link
Member

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

@roydondsouza
Copy link

Will do @MikeMcQuaid Thanks.

@Homebrew Homebrew locked and limited conversation to collaborators May 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Reproducible Homebrew/brew bug
Projects
None yet
Development

No branches or pull requests

5 participants