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: no implicit conversion of nil into String OR "undefined method `extname' for nil:NilClass" #7946

Closed
mungler opened this issue Dec 9, 2014 · 12 comments · Fixed by #7958

Comments

@mungler
Copy link

mungler commented Dec 9, 2014

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>'
@mungler
Copy link
Author

mungler commented Dec 9, 2014

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

@rolandwalker rolandwalker changed the title Error: no implicit conversion of nil into String when installing Adium Error: no implicit conversion of nil into String AND "undefined method `extname' for nil:NilClass" Dec 9, 2014
@rolandwalker
Copy link
Contributor

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.

@rolandwalker rolandwalker changed the title Error: no implicit conversion of nil into String AND "undefined method `extname' for nil:NilClass" Error: no implicit conversion of nil into String OR "undefined method `extname' for nil:NilClass" Dec 9, 2014
@renard
Copy link
Contributor

renard commented Dec 9, 2014

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

@renard
Copy link
Contributor

renard commented Dec 9, 2014

Confirmed.
A workaround is to use brew ea3eea82a74bb8636e1d01924fc3369c54770bee

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

and rock again!

@mungler
Copy link
Author

mungler commented Dec 9, 2014

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

@rolandwalker rolandwalker self-assigned this Dec 9, 2014
@rolandwalker
Copy link
Contributor

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

@renard
Copy link
Contributor

renard commented Dec 9, 2014

I guess cached_location should be used somewhere.

rolandwalker added a commit to rolandwalker/homebrew-cask that referenced this issue Dec 9, 2014
@rolandwalker
Copy link
Contributor

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.

@rolandwalker
Copy link
Contributor

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

@mungler
Copy link
Author

mungler commented Dec 10, 2014

@rolandwalker @renard you guys rock.

@mungler
Copy link
Author

mungler commented Dec 10, 2014

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

@rolandwalker
Copy link
Contributor

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 React to non-200 HTTP status codes #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.

jtimberman pushed a commit to sous-chefs/homebrew that referenced this issue Jan 11, 2015
Not having homebrew cask updated can lead to problems such as reported
in the following issues. The cask recipe should perform an update if
the auto-update attribute is true.

*
Homebrew/homebrew-cask#7946 (comment)
907
* chef-boneyard/pantry-chef-repo#9
jtimberman pushed a commit to sous-chefs/homebrew that referenced this issue Jan 11, 2015
Not having homebrew cask updated can lead to problems such as reported
in the following issues. The cask recipe should perform an update if
the auto-update attribute is true.

*
Homebrew/homebrew-cask#7946 (comment)
907
* chef-boneyard/pantry-chef-repo#9
@miccal miccal removed the chief bug label Dec 23, 2016
@Homebrew Homebrew locked and limited conversation to collaborators May 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants