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: undefined method `cask' for main:Object #8233

Closed
jsharf opened this issue Dec 18, 2014 · 5 comments
Closed

Error: undefined method `cask' for main:Object #8233

jsharf opened this issue Dec 18, 2014 · 5 comments

Comments

@jsharf
Copy link

jsharf commented Dec 18, 2014

[jsharf ~]$brew cask install amethyst
Error: undefined method cask' for main:Object Please report this bug: https://github.com/caskroom/homebrew-cask/issues /usr/local/Library/Taps/caskroom/homebrew-cask/Casks/amethyst.rb:1: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:inrequire'
/usr/local/Cellar/brew-cask/0.35.0/rubylib/cask/source/path.rb:13:in load' /usr/local/Cellar/brew-cask/0.35.0/rubylib/cask/source/tapped.rb:24:inload'
/usr/local/Cellar/brew-cask/0.35.0/rubylib/cask.rb:118:in load' /usr/local/Cellar/brew-cask/0.35.0/rubylib/cask/cli/install.rb:9:inblock in run'
/usr/local/Cellar/brew-cask/0.35.0/rubylib/cask/cli/install.rb:6:in each' /usr/local/Cellar/brew-cask/0.35.0/rubylib/cask/cli/install.rb:6:inrun'
/usr/local/Cellar/brew-cask/0.35.0/rubylib/cask/cli.rb:57:in run_command' /usr/local/Cellar/brew-cask/0.35.0/rubylib/cask/cli.rb:72:inprocess'
/usr/local/bin/brew-cask.rb:6:in <top (required)>' /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:inrequire'
/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:inrequire?'
/usr/local/Library/brew.rb:142:in `

'

@iggyvolz
Copy link
Contributor

Please update homebrew cask by using: brew update && brew upgrade brew-cask && brew cleanup && brew cask cleanup

This was an unforseen backwards compatibility break.

@rolandwalker
Copy link
Contributor

Hi @jsharf !

This was a very-much-foreseen backwards-compatibility break. We implemented a 6-month transition plan (#4688) which worked transparently for most folks. My sincere apologies that you caught the error here, but we are moving forward on our development plan.

The upgrade command sequence

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

should bring you up to the very latest and solve your issue.

@hoff2
Copy link

hoff2 commented Dec 18, 2014

This command sequence didn't help for me.

/opt/kitchenplan(master) $ brew update
Already up-to-date.
/opt/kitchenplan(master) $ brew upgrade brew-cask
Error: brew-cask-HEAD already installed
/opt/kitchenplan(master) $ brew cleanup
/opt/kitchenplan(master) $ brew cask cleanup
==> Removing dead symlinks
==> Removing cached downloads
/opt/kitchenplan(master) $ brew cask install --appdir=/Applications recordit
Error: undefined method `cask' for main:Object
Please report this bug:
    https://github.com/caskroom/homebrew-cask/issues
/usr/local/Library/Taps/caskroom/homebrew-cask/Casks/recordit.rb:1: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/Cellar/brew-cask/HEAD/rubylib/cask/source/path.rb:19:in `load'
/usr/local/Cellar/brew-cask/HEAD/rubylib/cask/source/tapped.rb:28:in `load'
/usr/local/Cellar/brew-cask/HEAD/rubylib/cask.rb:119:in `load'
/usr/local/Cellar/brew-cask/HEAD/rubylib/cask/cli/install.rb:9:in `block in run'
/usr/local/Cellar/brew-cask/HEAD/rubylib/cask/cli/install.rb:6:in `each'
/usr/local/Cellar/brew-cask/HEAD/rubylib/cask/cli/install.rb:6:in `run'
/usr/local/Cellar/brew-cask/HEAD/rubylib/cask/cli.rb:57:in `run_command'
/usr/local/Cellar/brew-cask/HEAD/rubylib/cask/cli.rb:72:in `process'
/usr/local/bin/brew-cask.rb:6: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>'

@hoff2
Copy link

hoff2 commented Dec 18, 2014

Fixed with:

brew uninstall brew-cask
brew install brew-cask

@rolandwalker
Copy link
Contributor

Error: brew-cask-HEAD already installed

That's right. If you installed a brew formula using the --HEAD option sometime in the past, you need to take special measures to upgrade it. The && in that ridiculous long command line would have stopped you right at brew upgrade brew-cask.

Glad you are sorted now.

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

4 participants