Skip to content

Exception after using install --force #7944

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

Closed
calebd opened this issue Dec 9, 2014 · 5 comments
Closed

Exception after using install --force #7944

calebd opened this issue Dec 9, 2014 · 5 comments

Comments

@calebd
Copy link

calebd commented Dec 9, 2014

I am unable to install a given application or package after using the --force option. Attempting to install (with or without force) after the first force install results in the following error:

Error: undefined method `extname' for nil:NilClass
/usr/local/Cellar/brew-cask/0.49.0/rubylib/cask/container/criteria.rb:43:in `extension'
/usr/local/Cellar/brew-cask/0.49.0/rubylib/cask/container/pkg.rb:3:in `me?'
/usr/local/Cellar/brew-cask/0.49.0/rubylib/cask/container.rb:50:in `block in for_path'
/usr/local/Cellar/brew-cask/0.49.0/rubylib/cask/container.rb:48:in `each'
/usr/local/Cellar/brew-cask/0.49.0/rubylib/cask/container.rb:48:in `find'
/usr/local/Cellar/brew-cask/0.49.0/rubylib/cask/container.rb:48:in `for_path'
/usr/local/Cellar/brew-cask/0.49.0/rubylib/cask/installer.rb:85:in `extract_primary_container'
/usr/local/Cellar/brew-cask/0.49.0/rubylib/cask/installer.rb:52: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>'
@rolandwalker
Copy link
Contributor

Hi! Thanks!

It does look like a bug, but it is likely to be dependent on the Cask, so we should have the exact sequence of commands you used. (Incidentally, --force does not store any state, at least not intentionally.)

@calebd
Copy link
Author

calebd commented Dec 9, 2014

I tried it with two different casks to be sure. Here was the sequence of events:

I ran brew cask instal sonos since the Sonos app kept bugging me about an update. It didn’t install since I already had it installed, so I ran brew cask install sonos --force. That’s when I got the error. Now I am unable to run either install or install --force without encountering the exception.

I was able to reproduce the bug with the Reveal cask.

@andreineculau
Copy link
Contributor

i just noticed something similar, although my command is brew cask install appfresh, no --force

// UPDATE sorry for hijacking your thread, @calebd . It's actually a similar error, but not the same
Error: undefined method 'extname' for 0:Fixnum.

/usr/local/Cellar/brew-cask/0.49.0/rubylib/cask/container/criteria.rb:43:in `extension'
/usr/local/Cellar/brew-cask/0.49.0/rubylib/cask/container/pkg.rb:3:in `me?'
/usr/local/Cellar/brew-cask/0.49.0/rubylib/cask/container.rb:50:in `block in for_path'
/usr/local/Cellar/brew-cask/0.49.0/rubylib/cask/container.rb:48:in `each'
/usr/local/Cellar/brew-cask/0.49.0/rubylib/cask/container.rb:48:in `find'
/usr/local/Cellar/brew-cask/0.49.0/rubylib/cask/container.rb:48:in `for_path'
/usr/local/Cellar/brew-cask/0.49.0/rubylib/cask/installer.rb:85:in `extract_primary_container'
/usr/local/Cellar/brew-cask/0.49.0/rubylib/cask/installer.rb:52: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>'

@jpmx
Copy link

jpmx commented Dec 9, 2014

Hi!,

Same error without --force and without Screenhero.dmg being mounted:

# brew update && brew upgrade brew-cask && brew cleanup && brew cask cleanup
Already up-to-date.
Error: brew-cask-0.49.0 already installed

# brew cask install screenhero
==> Downloading http://dl.screenhero.com/update/screenhero/Screenhero.dmg
Already downloaded: /Library/Caches/Homebrew/screenhero-latest.dmg
Error: undefined method `extname' for nil:NilClass
Please report this bug:
    https://github.com/caskroom/homebrew-cask/issues
/usr/local/Cellar/brew-cask/0.49.0/rubylib/cask/container/criteria.rb:43:in `extension'
/usr/local/Cellar/brew-cask/0.49.0/rubylib/cask/container/pkg.rb:3:in `me?'
/usr/local/Cellar/brew-cask/0.49.0/rubylib/cask/container.rb:50:in `block in for_path'
/usr/local/Cellar/brew-cask/0.49.0/rubylib/cask/container.rb:48:in `each'
/usr/local/Cellar/brew-cask/0.49.0/rubylib/cask/container.rb:48:in `find'
/usr/local/Cellar/brew-cask/0.49.0/rubylib/cask/container.rb:48:in `for_path'
/usr/local/Cellar/brew-cask/0.49.0/rubylib/cask/installer.rb:85:in `extract_primary_container'
/usr/local/Cellar/brew-cask/0.49.0/rubylib/cask/installer.rb:52: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>'

Full debug info:
https://gist.github.com/jpmx/4aa1356bbf0a58350edd

@rolandwalker
Copy link
Contributor

I suspect a change on Homebrew's side. Closing as a duplicate, further updates will be in #7946.

@miccal miccal removed the duplicate 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

No branches or pull requests

5 participants