Homebrew-cask: Bug report: `brew cask cleanup` results in "No such file or directory" error

Created on 11 Feb 2016  Â·  11Comments  Â·  Source: Homebrew/homebrew-cask

Description of issue

brew cask cleanup and brew cask doctor directory reference errors, even after uninstall --> update --> untap --> cleanup --> cask cleanup

Output of brew cask cleanup --verbose

$ brew cask cleanup --verbose
Error: No such file or directory - /Library/Caches/Homebrew/Casks
  Most likely, this means you have an outdated version of homebrew-cask. Please run:

      brew uninstall --force brew-cask; brew untap phinze/cask; brew update; brew cleanup; brew cask cleanup

  If this doesn’t fix the problem, please report this bug:

      https://github.com/caskroom/homebrew-cask#reporting-bugs

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/pathname.rb:425:in `open'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/pathname.rb:425:in `foreach'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/pathname.rb:425:in `children'
/usr/local/Library/Taps/caskroom/homebrew-cask/lib/hbc/cli/cleanup.rb:33:in `cache_symlinks'
/usr/local/Library/Taps/caskroom/homebrew-cask/lib/hbc/cli/cleanup.rb:41:in `cache_incompletes'
/usr/local/Library/Taps/caskroom/homebrew-cask/lib/hbc/cli/cleanup.rb:70:in `all_cache_files'
/usr/local/Library/Taps/caskroom/homebrew-cask/lib/hbc/cli/cleanup.rb:74:in `disk_cleanup_size'
/usr/local/Library/Taps/caskroom/homebrew-cask/lib/hbc/cli/cleanup.rb:10:in `run'
/usr/local/Library/Taps/caskroom/homebrew-cask/lib/hbc/cli.rb:83:in `run_command'
/usr/local/Library/Taps/caskroom/homebrew-cask/lib/hbc/cli.rb:121:in `process'
/usr/local/Library/Taps/caskroom/homebrew-cask/cmd/brew-cask.rb:26: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:21:in `require?'
/usr/local/Library/brew.rb:91:in `<main>'
Error: Kernel.exit

Output of brew doctor

$ brew doctor
Your system is ready to brew.

Output of brew cask doctor

$ brew cask doctor
==> OS X Release:
10.11
==> OS X Release with Patchlevel:
10.11.3
==> Hardware Architecture:
intel-64
==> Ruby Version:
2.0.0-p645
==> Ruby Path:
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
==> Homebrew Version:
Homebrew 0.9.5 (git revision c343; last commit 2016-02-10)
==> Homebrew Executable Path:
/usr/local/bin/brew
==> Homebrew Cellar Path:
/usr/local/Cellar
==> Homebrew Repository Path:
/usr/local
==> Homebrew Origin:
https://github.com/Homebrew/homebrew
==> Homebrew-cask Version:
0.60.0 (git revision a540; last commit 8 hours ago)
==> Homebrew-cask Install Location:
<NONE>
==> Homebrew-cask Staging Location:
/opt/homebrew-cask/Caskroom
Error: No such file or directory - /Library/Caches/Homebrew/Casks
  Most likely, this means you have an outdated version of homebrew-cask. Please run:

      brew uninstall --force brew-cask; brew untap phinze/cask; brew update; brew cleanup; brew cask cleanup

  If this doesn’t fix the problem, please report this bug:

      https://github.com/caskroom/homebrew-cask#reporting-bugs

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/pathname.rb:425:in `open'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/pathname.rb:425:in `foreach'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/pathname.rb:425:in `children'
/usr/local/Library/Taps/caskroom/homebrew-cask/lib/hbc/cli/cleanup.rb:33:in `cache_symlinks'
/usr/local/Library/Taps/caskroom/homebrew-cask/lib/hbc/cli/cleanup.rb:41:in `cache_incompletes'
/usr/local/Library/Taps/caskroom/homebrew-cask/lib/hbc/cli/cleanup.rb:70:in `all_cache_files'
/usr/local/Library/Taps/caskroom/homebrew-cask/lib/hbc/cli/doctor.rb:220:in `render_cached_downloads'
/usr/local/Library/Taps/caskroom/homebrew-cask/lib/hbc/cli/doctor.rb:17:in `run'
/usr/local/Library/Taps/caskroom/homebrew-cask/lib/hbc/cli.rb:83:in `run_command'
/usr/local/Library/Taps/caskroom/homebrew-cask/lib/hbc/cli.rb:121:in `process'
/usr/local/Library/Taps/caskroom/homebrew-cask/cmd/brew-cask.rb:26: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:21:in `require?'
/usr/local/Library/brew.rb:91:in `<main>'

Most helpful comment

Same.

⬡  brew cask cleanup --verbose
Error: No such file or directory - /Library/Caches/Homebrew/Casks
  Most likely, this means you have an outdated version of homebrew-cask. Please run:

      brew uninstall --force brew-cask; brew untap phinze/cask; brew update; brew cleanup; brew cask cleanup

  If this doesn’t fix the problem, please report this bug:

      https://github.com/caskroom/homebrew-cask#reporting-bugs

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/pathname.rb:425:in `open'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/pathname.rb:425:in `foreach'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/pathname.rb:425:in `children'
/usr/local/Library/Taps/caskroom/homebrew-cask/lib/hbc/cli/cleanup.rb:33:in `cache_symlinks'
/usr/local/Library/Taps/caskroom/homebrew-cask/lib/hbc/cli/cleanup.rb:41:in `cache_incompletes'
/usr/local/Library/Taps/caskroom/homebrew-cask/lib/hbc/cli/cleanup.rb:70:in `all_cache_files'
/usr/local/Library/Taps/caskroom/homebrew-cask/lib/hbc/cli/cleanup.rb:74:in `disk_cleanup_size'
/usr/local/Library/Taps/caskroom/homebrew-cask/lib/hbc/cli/cleanup.rb:10:in `run'
/usr/local/Library/Taps/caskroom/homebrew-cask/lib/hbc/cli.rb:83:in `run_command'
/usr/local/Library/Taps/caskroom/homebrew-cask/lib/hbc/cli.rb:121:in `process'
/usr/local/Library/Taps/caskroom/homebrew-cask/cmd/brew-cask.rb:26: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:21:in `require?'
/usr/local/Library/brew.rb:89:in `<main>'
Error: Kernel.exit

All 11 comments

Error: No such file or directory - /Library/Caches/Homebrew/Casks

Make it: mkdir -p '/Library/Caches/Homebrew/Casks'.

this solution is only good until rm -rf $(brew --cache) is run. this cleanup function used to be able to withstand a cleaned up cache directory without failing as an error.

On Feb 11, 2016, at 8:04 AM, Vítor Galvão [email protected] wrote:

Make it: mkdir -p '/Library/Caches/Homebrew/Casks'.

Seems like a bug to me. I'll take a look later this evening.

i have the same probablem,how to fix this? mkdir in the /Library/Caches/Homebrew/Casks?

so i try this mkdir /Library/Caches/Homebrew/Casks and it is useful

@dreamkidd Yes, for now that should work.

Looks like init in hbc.rb isn't being called for those that are having problems.

Adding HOMEBREW_CACHE_CASKS.mkpath unless HOMEBREW_CACHE_CASKS.exist? to cleanup.rb seems like it should do the trick, but it doesn't solve the root problem (ie. Why does this happen to some people), AFAIK.

Looks like init in hbc.rb isn't being called for those that are having problems.

Haven’t looked at it yet, but as soon as I read that, I immediately remembered there were some changes around those parts recently.

Same.

⬡  brew cask cleanup --verbose
Error: No such file or directory - /Library/Caches/Homebrew/Casks
  Most likely, this means you have an outdated version of homebrew-cask. Please run:

      brew uninstall --force brew-cask; brew untap phinze/cask; brew update; brew cleanup; brew cask cleanup

  If this doesn’t fix the problem, please report this bug:

      https://github.com/caskroom/homebrew-cask#reporting-bugs

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/pathname.rb:425:in `open'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/pathname.rb:425:in `foreach'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/pathname.rb:425:in `children'
/usr/local/Library/Taps/caskroom/homebrew-cask/lib/hbc/cli/cleanup.rb:33:in `cache_symlinks'
/usr/local/Library/Taps/caskroom/homebrew-cask/lib/hbc/cli/cleanup.rb:41:in `cache_incompletes'
/usr/local/Library/Taps/caskroom/homebrew-cask/lib/hbc/cli/cleanup.rb:70:in `all_cache_files'
/usr/local/Library/Taps/caskroom/homebrew-cask/lib/hbc/cli/cleanup.rb:74:in `disk_cleanup_size'
/usr/local/Library/Taps/caskroom/homebrew-cask/lib/hbc/cli/cleanup.rb:10:in `run'
/usr/local/Library/Taps/caskroom/homebrew-cask/lib/hbc/cli.rb:83:in `run_command'
/usr/local/Library/Taps/caskroom/homebrew-cask/lib/hbc/cli.rb:121:in `process'
/usr/local/Library/Taps/caskroom/homebrew-cask/cmd/brew-cask.rb:26: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:21:in `require?'
/usr/local/Library/brew.rb:89:in `<main>'
Error: Kernel.exit

still the same "bug" for me

still the same "bug" for me
and mkdir /Library/Caches/Homebrew/Casks is useful

Locking, since only noise is being added. You’re all still getting this bug because it hasn’t yet been fixed. That is why the issue is still open. Only after the issue has been reported as fixed and closed is it worthwhile noting if it still occurs. Until then, we know it still occurs.

Was this page helpful?
0 / 5 - 0 ratings