brew update時老是報錯,后查了stackoverflow才發現問題,是我自己把usr/local/下的share里面文件刪了。
解決方式很簡單:
因為brew安裝完,默認放置地址都是usr/local下,且是用git去管理。
git status //看到很多被刪除記錄
git checkout -- *.rb *.png //從staged暫存區中,回復被刪除文件。
回復后,brew update 就ok了。
但由於本人典型程序員龜毛本性,總感覺清理不干凈。於是:
卸載
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
安裝
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew 變成最新的了。哇嘎嘎,,,
備注:
還會碰到這個bug:rbconfig.rb:213: warning: Insecure world writable
打開mac 下的 “磁盤工具” ---》點擊“急救”,權限等會自動回復。 如果是老版本,點擊“修復磁盤權限”即可。
相關鏈接:
http://stackoverflow.com/questions/24652996/homebrew-not-working-on-osx //kernel_require 問題的解決文檔
https://ruby-china.org/topics/19321 //rbconfig.rb的問題解決文檔