Homebrew/homebrew-cask

Error: no implicit conversion of nil into String OR "undefined method `extname' for nil:NilClass"

Closed this issue · 12 comments

Hit an issue trying to set up a new Mac this evening. Reporting because it asked me to. Any advice?

Eddie:~ rory$ brew cask install adium
==> Downloading http://download.adium.im/Adium_1.5.10.dmg
Already downloaded: /Library/Caches/Homebrew/adium-1.5.10.dmg
Error: no implicit conversion of nil into String
Please report this bug:
    https://github.com/caskroom/homebrew-cask/issues
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/digest.rb:44:in `initialize'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/digest.rb:44:in `open'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/digest.rb:44:in `file'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/digest.rb:29:in `file'
/usr/local/Cellar/brew-cask/0.49.0/rubylib/cask/download.rb:40:in `block in _check_sums'
/usr/local/Cellar/brew-cask/0.49.0/rubylib/cask/download.rb:38:in `each'
/usr/local/Cellar/brew-cask/0.49.0/rubylib/cask/download.rb:38:in `_check_sums'
/usr/local/Cellar/brew-cask/0.49.0/rubylib/cask/download.rb:31:in `perform'
/usr/local/Cellar/brew-cask/0.49.0/rubylib/cask/installer.rb:74:in `download'
/usr/local/Cellar/brew-cask/0.49.0/rubylib/cask/installer.rb:51:in `install'
/usr/local/Cellar/brew-cask/0.49.0/rubylib/cask/cli/install.rb:20:in `block in install_casks'
/usr/local/Cellar/brew-cask/0.49.0/rubylib/cask/cli/install.rb:17:in `each'
/usr/local/Cellar/brew-cask/0.49.0/rubylib/cask/cli/install.rb:17:in `install_casks'
/usr/local/Cellar/brew-cask/0.49.0/rubylib/cask/cli/install.rb:6:in `run'
/usr/local/Cellar/brew-cask/0.49.0/rubylib/cask/cli.rb:81:in `run_command'
/usr/local/Cellar/brew-cask/0.49.0/rubylib/cask/cli.rb:121:in `process'
/usr/local/bin/brew-cask.rb:42:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/local/Library/brew.rb:59:in `require?'
/usr/local/Library/brew.rb:142:in `<main>'

Actually I appear to get this with all install options - I think I have a bad cask tapped..

Hi!

There are a group of similar issues filed in the last few hours. My guess is that something changed today on Homebrew's side that broke our assumptions (our released code hasn't changed since 2 Dec).

Unfortunately I may not have a chance to look at this for many hours, possibly tomorrow. Pinging @claui @federicobond @ndr-qef in case you are interested.

Since your issue had the most general name already, I revised the title a bit and made it the chief bug.

Seems like Homebrew/legacy-homebrew@c9ebe08 causes the issue.

Confirmed.
A workaround is to use brew ea3eea82a74bb8636e1d01924fc3369c54770bee

cd /usr/local/
git checkout -b fix-curl ea3eea82a74bb8636e1d01924fc3369c54770bee

and rock again!

@rolandwalker @renard thanks guys! That's some amazing timing - the retina iMac I've been waiting for for weeks finally arrive and my fancy-schmancy auto-setup script explodes. :)

Thanks for the efforts on a workaround and hopefully a fix sometime soon. :)

@renard thanks a million! I'm looking at it now.

I guess cached_location should be used somewhere.

Yes, I saw that, but I went with tarball_path, reasoning, at least for the purpose of immediate fix

  • this is exact compatibility with what happened before
  • they reference other download strategies, but we only have to worry about CurlDownloadStrategy here. Our Cask::SubversionDownloadStrategy already takes care of this issue explicitly, and we don't support any others than those two.

@renard your analysis saved so much time, thanks again.

Just cut release v0.50.0 which contains this fix. The following command should fix the issue:

$ brew update && brew upgrade brew-cask && brew cleanup && brew cask cleanup

@rolandwalker @renard you guys rock.

Can confirm v0.50.0 solves the issue for me. Nice work gents.

Cross referencing #5080 and this code comment about how we abuse Homebrew's classes.

Pretty much everything is wrong about the architecture here because

  • we shouldn't be invoking Homebrew's Ruby methods or depending on their classes1
  • Homebrew doesn't guarantee any internal APIs and they shouldn't have to
  • the arrangement is fragile
  • breakdowns affect many users as we see here and the 11-and-counting-duplicates
  • it is difficult to address issues such #7883, because important code is out of our jurisdiction

1 It is OK to invoke the brew executable via system as we do for formula dependencies. The CLI is Homebrew's guaranteed interface.