升級了 Xcode7.3后所森,發(fā)現(xiàn) Chisel 突然不好使了芥备,于是再度打開主頁溪窒,想升級一下應(yīng)該能解決問題.
按照官方說明坤塞,需要首先升級 homebrew ,其實知道 澈蚌,這一步不是必須的摹芙。但是為了后面不出現(xiàn)問題,還是順手一并升級吧!
然后,開始了問題之旅:
使用 brew update
,結(jié)果得到了以下提示:
warning: unable to unlink CONTRIBUTING.md: Permission denied
warning: unable to unlink SUPPORTERS.md: Permission denied
fatal: cannot create directory at '.github': Permission denied
不難看出,是權(quán)限問題,修改權(quán)限
sudo chmod -R 777 /usr/local
相關(guān)知識:
可以不必修改為 777 的, 關(guān)于權(quán)限的更多,感興趣的可以自行 google
r表示讀權(quán)限,4 , w表示寫權(quán)限宛瞄,2 , x表示執(zhí)行權(quán)限浮禾, 1
可是修改之后,仍然不好用.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- mach (LoadError)
一不做,二不休,干脆嘗試重新安裝 homebrew
在終端輸入
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
然后得到了下面的提示
kenny@kenny:~|? /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
-e:77: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
It appears Homebrew is already installed. If your intent is to reinstall you
should do the following before running this installer again:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
The current contents of /usr/local are bin Cellar CODEOFCONDUCT.md CONTRIBUTING.md etc include lib Library LICENSE.txt opt README.md sbin share SUPPORTERS.md var .git .gitignore
提示的是 git 的錯誤
嘗試 cd 到/usr/local
目錄下,
git status
果然有一堆修改內(nèi)容,這些應(yīng)該是之前各種操作沒有成功完成,導(dǎo)致修改沒有被妥善處理
然后:
git reset --hard
kenny@kenny:/usr/local|master? git status On branch master nothing to commit, working directory clean
可能還需要執(zhí)行:
git clean -df
第一個是放棄已經(jīng) stage 的文件的更改
第二個是對沒有 stage 的文件進(jìn)行放棄
執(zhí)行安裝
Error: chisel-1.2.0 already installed
To install this version, first `brew unlink chisel`
卸載舊版
Unlinking /usr/local/Cellar/chisel/1.2.0... 0 symlinks removed```
重新安裝
```kenny@kenny:/usr/local|master? brew install chisel
==> Downloading https://github.com/facebook/chisel/archive/1.4.0.tar.gz
==> Downloading from https://codeload.github.com/facebook/chisel/tar.gz/1.4.0```
可以看到,現(xiàn)在升級到了1.4了.
到 Xcode 中測試,發(fā)現(xiàn)也歡樂的好用了 !