最近在使用pod install命令時一直報錯:bash
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /usr/bin directory. 複製代碼
錯誤信息顯示權限不夠,好吧,修改權限session
sudo gem install cocoapods --pre
sudo chmod 777 /Library/Ruby/Gems/2.3.0
複製代碼
試試證實以上命令均無效: 最後使用一下命令安裝成功ui
sudo gem install cocoapods -n /usr/local/bin
複製代碼
而後this
pod install
複製代碼
成功執行spa
Analyzing dependencies
Downloading dependencies
Installing SDWebImage (4.3.3)
Generating Pods project
Integrating client project
[!] Please close any current Xcode sessions and use `MainProject.xcworkspace` for this project from now on.
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.
複製代碼