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

OS X Yosemite: after installing brew-cask, brew doesn't recognize it as a command #4685

Closed
kreeger opened this issue Jun 4, 2014 · 15 comments

Comments

@kreeger
Copy link

kreeger commented Jun 4, 2014

Image

@tcarlsen and I have been seeing this issue on Yosemite. The homebrew team patched things up throughout the day on Tuesday and now brew itself appears to work okay; I was able to install tons and tons of recipes on a fresh install of Yosemite through home-brew.

brew-cask on the other hand doesn't seem to get noticed by brew after it's tapped on a fresh install of Yosemite. See screenshot above.

It'd be great to get brew-cask working again. I miss it already! (I don't know enough about homebrew's inner workings yet, otherwise I'd submit a PR. 🍻 to who does, though!)

This issue was spun off of issue #4667.

@tcarlsen
Copy link
Contributor

tcarlsen commented Jun 4, 2014

I did a update of Yosemite, not a fresh install

@rolandwalker
Copy link
Contributor

Homebrew finds external commands such as brew-cask.rb by virtue of their being on the $PATH and by having their executable bit set. The part about the executable bit is a little strange, because the file gets required by Ruby, not executed, but that's how Homebrew does it. (Or maybe did it until today, as something is not working for you.)

If you have installed to the default locations, Homebrew should have created a symlink at

/usr/local/bin/brew-cask.rb

which refers to an executable file at (currently)

/usr/local/Cellar/brew-cask/0.35.0/bin/brew-cask.rb

So, for the command brew cask to work, things should look something like this:

$ printenv PATH
/usr/bin:/usr/local/bin:.....
$ ls -la /usr/local/bin/brew-cask.rb
lrwxr-xr-x 1 user staff 43 May  9 10:25 /usr/local/bin/brew-cask.rb -> ../Cellar/brew-cask/0.35.0/bin/brew-cask.rb
$ ls -la /usr/local/Cellar/brew-cask/0.35.0/bin/brew-cask.rb
-rwxr-xr-x 1 user staff 203 May  9 10:25 /usr/local/Cellar/brew-cask/0.35.0/bin/brew-cask.rb

(Note that, confusingly, there are two different brew-cask.rb files. The one at /usr/local/Library/Formula/brew-cask.rb is the Formula used for installing this project, the one given above is the external command invoked by brew cask.)

@tcarlsen
Copy link
Contributor

tcarlsen commented Jun 4, 2014

@rolandwalker hers mine:

$ printenv PATH
/Users/tcarlsen/.nvm/v0.10.26/bin:./bin:/usr/local/bin:/usr/local/sbin:/Users/tcarlsen/.dotfiles/bin:/Users/tcarlsen/.rbenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
$ ls -la /usr/local/bin/brew-cask.rb
lrwxr-xr-x 1 tcarlsen admin 43 Jun  4 20:37 /usr/local/bin/brew-cask.rb -> ../Cellar/brew-cask/0.35.0/bin/brew-cask.rb*
$ ls -la /usr/local/Cellar/brew-cask/0.35.0/bin/brew-cask.rb
-rwxr-xr-x 1 tcarlsen staff 203 Jun  4 20:37 /usr/local/Cellar/brew-cask/0.35.0/bin/brew-cask.rb*

and /usr/local/bin/brew-cask.rb do ref to /usr/local/Cellar/brew-cask/0.35.0/bin/brew-cask.rb

@rolandwalker
Copy link
Contributor

Those files look kosher, but your $PATH might be trouble. rbenv shims could certainly affect matters. I would try radically simplifying $PATH:

$ PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/sbin brew cask

as well as checking the output of brew doctor.

It seems that Homebrew switched to Ruby 2.0 to make things work on Yosemite. That's a fairly major jump from 1.8. (I'm surprised the breakage is not greater.)

@caarlos0
Copy link
Sponsor Contributor

caarlos0 commented Jun 5, 2014

Same issue here:

2.1.1 in carlos/
› PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/sbin brew cask
Error: Unknown command: cask

2.1.1 in carlos/
› brew doctor
Error: No such file or directory - /Library/Developer/CommandLineTools/usr/bin/clang

@amdprophet
Copy link

I made a symlink from /Library/Developer/CommandLineTools/usr/bin/clang to /Applications/Xcode6-Beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang /Library/Developer/CommandLineTools/usr/bin/clang and brew doctor is working now.

Nothing out of the ordinary in the brew doctor output.

@kreeger
Copy link
Author

kreeger commented Jun 5, 2014

I figured out that iTerm2 is the culprit; it's not picking up $PATH properly in certain environments. I'm seeing it all over the place, even with stock homebrew now (and with direnv).

Running it in Terminal.app performs just fine.

Related issue here: Homebrew/legacy-homebrew#29843

@caarlos0
Copy link
Sponsor Contributor

caarlos0 commented Jun 5, 2014

@kreeger indeed... and this is really weird.

@nanoxd
Copy link
Contributor

nanoxd commented Jun 5, 2014

@kreeger If you use tmux in iTerm2 the problem goes away.

@kreeger
Copy link
Author

kreeger commented Jun 5, 2014

A bug report has been filed on iTerm2 (whether or not it's a bug with iTerm2) right here. If there indeed is an issue with OS X 10.10 and not iTerm2, then it's probably a good idea for us to use this fix and let iTerm2 weather out the ever-changing-and-fixing-Developer-Preview storm.

@tcarlsen
Copy link
Contributor

tcarlsen commented Jun 6, 2014

@kreeger that did it for me!!!

For those who come later, using iTerm2:

  • Go to Profiles > Open Profiles...
  • Select your profile, Default if you only have one, then click the Edit Profiles... button
  • Change the Command radio button from Login shell to Command and paste in /bin/bash -c /bin/zsh. See screenshot:

@rolandwalker
Copy link
Contributor

My understanding is that this bug does not touch on any code in Homebrew-cask, and there's nothing we can fix.

However, it would be nice to leave the issue open for a little while to help other people find these solutions.

@rolandwalker
Copy link
Contributor

The cross-reference with #4869 (zap stanza) is just a typo, since corrected there.

@dzegna
Copy link

dzegna commented Oct 18, 2014

@kreeger @tcarlsen Thanks guys! I just updated to Yosemite today and happened to stumble onto cask as I was doing my development setup. I'm using iTerm2 and couldn't figure out what I was doing wrong trying to get cask to work.

@tcarlsen
Copy link
Contributor

Hope you got it running @dzegna?

@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

8 participants