这是错误:
$ brew cask install sublime-text
错误:没有这样的文件或目录-brew-cask
答案 0 :(得分:1)
brew cask install
当天早些时候工作,所以我希望只是加载路径的变化会影响shell查找和运行brew cask install
命令的能力。
所以,我做了详尽的搜索:
$ find / \( -name "brew\-cask*" -type f \) -or \( -ilname "*brew-cask*" \) 2>/dev/null | grep brew-cask | xargs ls -l
-rw-r--r-- 1 lex admin 0 Sep 1 16:42 /Library/Caches/Homebrew/Formula/brew-cask.brewing
-rwxr-xr-x 1 lex admin 193 Aug 31 20:35 /Library/Caches/Homebrew/brew-cask--git/bin/brew-cask.rb
-rw-r--r-- 1 lex admin 470 Aug 31 20:35 /Library/Caches/Homebrew/brew-cask--git/brew-cask.rb
-rwxr-xr-x 1 lex wheel 197 Sep 1 16:39 /usr/local/Cellar/brew-cask/0.15.0/bin/brew-cask.rb
lrwxr-xr-x 1 lex admin 32 Aug 31 20:35 /usr/local/Library/Formula/brew-cask.rb -> ../Taps/phinze-cask/brew-cask.rb
lrwxr-xr-x 1 lex admin 29 Sep 1 16:39 /usr/local/Library/LinkedKegs/brew-cask -> ../../Cellar/brew-cask/0.15.0
-rwxr-xr-x 1 lex admin 193 Aug 31 20:35 /usr/local/Library/Taps/phinze-cask/bin/brew-cask.rb
-rw-r--r-- 1 lex admin 470 Aug 31 20:35 /usr/local/Library/Taps/phinze-cask/brew-cask.rb
lrwxr-xr-x 1 lex admin 43 Sep 1 16:39 /usr/local/bin/brew-cask.rb -> ../Cellar/brew-cask/0.15.0/bin/brew-cask.rb
lrwxr-xr-x 1 lex admin 26 Sep 1 16:39 /usr/local/opt/brew-cask -> ../Cellar/brew-cask/0.15.0
最后两行看起来很有意思......
$ ls -l /usr/local/Cellar/brew-cask/0.15.0/bin/brew-cask.rb
-rwxr-xr-x 1 lex wheel 197 Sep 1 16:39 /usr/local/Cellar/brew-cask/0.15.0/bin/brew-cask.rb
$ ls -l /usr/local/Cellar/brew-cask/0.15.0
total 16
drwxr-xr-x 421 lex wheel 14314 Sep 1 16:39 Casks
-rw-r--r-- 1 lex admin 226 Sep 1 16:39 INSTALL_RECEIPT.json
-rw-r--r-- 1 lex wheel 1909 Sep 1 16:39 README.md
drwxr-xr-x 3 lex wheel 102 Sep 1 16:39 bin
drwxr-xr-x 5 lex wheel 170 Sep 1 16:39 rubylib
嗯... /usr/local/opt/brew-cask
指向一个包含bin目录的目录,然后包含brew-cask ......
然后,我看着我的载重路径......
$ echo $PATH
/Users/lex/.rbenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/opt/coreutils/libexec/gnubin:/Users/lex/.rbenv/bin:/Users/lex/.rbenv/shims:/Users/lex/bin:/usr/local/opt:/usr/local/bin:/usr/bin
果然,在将文件加载到/ usr / local / bin之前,我的PATH已被更改为在/usr/local/opt
中加载文件。
/usr/local/opt
目录中的其他“可执行文件”类似。所以,我把它从我的路径中删除了。
我再试一次......
$ brew cask install sublime-text
==> Downloading http://c758482.r82.cf2.rackcdn.com/Sublime%20Text%202.0.2.dmg
######################################################################## 100.0%
==> Success! sublime-text installed to /opt/homebrew-cask/Caskroom/sublime-text/2.0.2
==> Linking Sublime Text 2.app to /Users/lex/Applications/Sublime Text 2.app
成功: - )