Homebrew / homebrew-cask

🍻 A CLI workflow for the administration of macOS applications distributed as binaries
https://brew.sh
BSD 2-Clause "Simplified" License
20.92k stars 10.71k forks source link

Linking fails when running "brew cask linkapps" #677

Closed PerWiklander closed 11 years ago

PerWiklander commented 11 years ago
==> Linking IntelliJ IDEA 12.app to /Users/per/Applications/IntelliJ IDEA 12.app
Error: undefined method `basename' for nil:NilClass
Please report this bug:
    https://github.com/mxcl/homebrew/wiki/troubleshooting
/usr/local/Cellar/brew-cask/0.14.0/rubylib/cask/app_linker.rb:24:in `link_app'
/usr/local/Cellar/brew-cask/0.14.0/rubylib/cask/app_linker.rb:8:in `link'
/usr/local/Cellar/brew-cask/0.14.0/rubylib/cask/app_linker.rb:8:in `each'
/usr/local/Cellar/brew-cask/0.14.0/rubylib/cask/app_linker.rb:8:in `link'
/usr/local/Cellar/brew-cask/0.14.0/rubylib/cask/cli/linkapps.rb:5:in `run'
/usr/local/Cellar/brew-cask/0.14.0/rubylib/cask/cli/linkapps.rb:4:in `each'
/usr/local/Cellar/brew-cask/0.14.0/rubylib/cask/cli/linkapps.rb:4:in `run'
/usr/local/Cellar/brew-cask/0.14.0/rubylib/cask/cli.rb:21:in `process'
/usr/local/bin/brew-cask.rb:6
/usr/local/Library/brew.rb:51:in `require'
/usr/local/Library/brew.rb:51:in `require?'
/usr/local/Library/brew.rb:101

If I move IntelliJ out of the cask dir and rerun I get the same failure for another app.

==> Linking Google Drive.app to /Users/per/Applications/Google Drive.app
Error: undefined method `basename' for nil:NilClass
Please report this bug:
    https://github.com/mxcl/homebrew/wiki/troubleshooting
/usr/local/Cellar/brew-cask/0.14.0/rubylib/cask/app_linker.rb:24:in `link_app'
/usr/local/Cellar/brew-cask/0.14.0/rubylib/cask/app_linker.rb:8:in `link'
/usr/local/Cellar/brew-cask/0.14.0/rubylib/cask/app_linker.rb:8:in `each'
/usr/local/Cellar/brew-cask/0.14.0/rubylib/cask/app_linker.rb:8:in `link'
/usr/local/Cellar/brew-cask/0.14.0/rubylib/cask/cli/linkapps.rb:5:in `run'
/usr/local/Cellar/brew-cask/0.14.0/rubylib/cask/cli/linkapps.rb:4:in `each'
/usr/local/Cellar/brew-cask/0.14.0/rubylib/cask/cli/linkapps.rb:4:in `run'
/usr/local/Cellar/brew-cask/0.14.0/rubylib/cask/cli.rb:21:in `process'
/usr/local/bin/brew-cask.rb:6
/usr/local/Library/brew.rb:51:in `require'
/usr/local/Library/brew.rb:51:in `require?'
/usr/local/Library/brew.rb:101
vitorgalvao commented 11 years ago

Let’s get the obvious stuff out of the way, first. Let’s be sure you’re running the latest version, since it has been updated recently, by running brew update && brew upgrade brew-cask. You should be now at version 0.14.1.

Do you have that error with every cask, or just some?

jtmoulia commented 11 years ago

I might be seeing the same problem.

This is my first time using brew-cask (awesome), which I used to install firefox. Firefox didn't appear in my Applications folder, and running brew cask linkapps spit out (even after @vitorgalvao 's suggestion):

$ brew cask linkapps
Error: undefined method `basename' for nil:NilClass
Please report this bug:
    https://github.com/mxcl/homebrew/wiki/troubleshooting
/usr/local/Cellar/brew-cask/0.14.1/rubylib/cask/app_linker.rb:24:in `link_app'
/usr/local/Cellar/brew-cask/0.14.1/rubylib/cask/app_linker.rb:8:in `link'
/usr/local/Cellar/brew-cask/0.14.1/rubylib/cask/app_linker.rb:8:in `each'
/usr/local/Cellar/brew-cask/0.14.1/rubylib/cask/app_linker.rb:8:in `link'
/usr/local/Cellar/brew-cask/0.14.1/rubylib/cask/cli/linkapps.rb:5:in `run'
/usr/local/Cellar/brew-cask/0.14.1/rubylib/cask/cli/linkapps.rb:4:in `each'
/usr/local/Cellar/brew-cask/0.14.1/rubylib/cask/cli/linkapps.rb:4:in `run'
/usr/local/Cellar/brew-cask/0.14.1/rubylib/cask/cli.rb:21:in `process'
/usr/local/bin/brew-cask.rb:6
/usr/local/Library/brew.rb:51:in `require'
/usr/local/Library/brew.rb:51:in `require?'
/usr/local/Library/brew.rb:101

Thanks in advance for any help!

vitorgalvao commented 11 years ago

Application links should appear (by default) in ~/Applications (the one inside your home directory), not /Applications (the one at the root); where did you look for it? They are also linked by default, so there should be no need to run brew cask linkapps unless you’ve unlinked/deleted them.

Please paste the output of brew cask list and brew doctor, so we can examine it.

jtmoulia commented 11 years ago

Sorry, you're totally right about the apps showing up in ~/Applications. Thanks!

brew cask linkapps isn't necessary for me now, but in case you're still curious:

$ brew cask list
firefox   hip-chat  rdio
$ brew doctor
Your system is ready to brew.
junkblocker commented 11 years ago

Same issue here: Only happens with The Unarchiver.app (the-unarchiver) which I've removed from cache, uninstalled and reinstalled many times to no effect.

==> Linking The Unarchiver.app to /Users/work/Applications/The Unarchiver.app
Error: undefined method `basename' for nil:NilClass
Please report this bug:
    https://github.com/mxcl/homebrew/wiki/troubleshooting
/usr/brew/Cellar/brew-cask/0.14.1/rubylib/cask/app_linker.rb:24:in `link_app'
/usr/brew/Cellar/brew-cask/0.14.1/rubylib/cask/app_linker.rb:8:in `link'
/usr/brew/Cellar/brew-cask/0.14.1/rubylib/cask/app_linker.rb:8:in `each'
/usr/brew/Cellar/brew-cask/0.14.1/rubylib/cask/app_linker.rb:8:in `link'
/usr/brew/Cellar/brew-cask/0.14.1/rubylib/cask/cli/linkapps.rb:5:in `run'
/usr/brew/Cellar/brew-cask/0.14.1/rubylib/cask/cli/linkapps.rb:4:in `each'
/usr/brew/Cellar/brew-cask/0.14.1/rubylib/cask/cli/linkapps.rb:4:in `run'
/usr/brew/Cellar/brew-cask/0.14.1/rubylib/cask/cli.rb:21:in `process'
/usr/brew/bin/brew-cask.rb:6
/usr/brew/Library/brew.rb:51:in `require'
/usr/brew/Library/brew.rb:51:in `require?'
/usr/brew/Library/brew.rb:101

% brew cask list
adapter                  bettertouchtool          clamxav                  geektool                 lastfm                   sigil                    unetbootin
android-file-transfer    bit-torrent-sync         controlplane             gimp                     lime-chat                sourcetree               vlc
anki                     caffeine                 cyberduck                github                   notational-velocity      sublime-text             x-quartz
app-cleaner              calibre                  dia                      grand-perspective        onyx                     the-unarchiver           xld
audacity                 chromium                 dropbox                  hiss                     platypus                 u-torrent                xtra-finder

% brew doctor
Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use when
compiling and linking.

Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew provided
script of the same name. We found the following "config" scripts:

    /System/Library/Frameworks/Python.framework/Versions/Current/bin/python-config
    /System/Library/Frameworks/Python.framework/Versions/Current/bin/python2.7-config

Warning: Your Homebrew is not installed to /usr/local
You can install Homebrew anywhere you want, but some brews may only build
correctly if you install in /usr/local. Sorry!
phinze commented 11 years ago

brew cask linkapps is no longer with us, and i think we have a few other issues to track the remaining issues we have with linking, so i'm going to close this one for now. :sleeping: