-
1.升級(jí)Ruby環(huán)境
sudo gem update --system
接下來會(huì)提示密文輸入密碼(直接輸入密碼就可以)
-
2.更換鏡像
gem sources --remove https://rubygems.org/
移除現(xiàn)有鏡像文件
更新鏡像文件
gem source -a https://gems.ruby-china.org/
淘寶的已經(jīng)不更新了,用國(guó)外的需要翻墻,這就很尷尬
查看鏡像文件
gem sources -l
如果結(jié)果是
*** CURRENT SOURCES ***
https://gems.ruby-china.org/
說明添加成功蕴侣,否則繼續(xù)執(zhí)行$ gem source -a https://gems.ruby-china.org/來添加
-
3风范、安裝CocoaPods
鍵入以下指令
sudo gem install cocoa pods
如果不行,執(zhí)行下面這段
sudo gem install -n /usr/local/bin cocoapods
運(yùn)行pod
pod setup
當(dāng)出現(xiàn) Setup completed 時(shí)說明已經(jīng)完成
iOS "The sandbox is not in sync with the Podfile.lock"解決方案
rm -rf MyProject.xcworkspace
pod install
pod命令
Usage:
$ pod COMMAND
CocoaPods, the Cocoa library package manager.
Commands:
+ cache Manipulate the CocoaPods cache
+ deintegrate Deintegrate CocoaPods from your project
+ env Display pod environment
+ init Generate a Podfile for the current directory
+ install Install project dependencies according to versions from a
Podfile.lock
+ ipc Inter-process communication
+ lib Develop pods
+ list List pods
+ outdated Show outdated project dependencies
+ plugins Show available CocoaPods plugins
+ repo Manage spec-repositories
+ search Search for pods
+ setup Setup the CocoaPods environment
+ spec Manage pod specs
+ trunk Interact with the CocoaPods API (e.g. publishing new specs)
+ try Try a Pod!
+ update Update outdated project dependencies and create new
Podfile.lock
Options:
--silent Show nothing
--version Show the version of the tool
--verbose Show more debugging information
--no-ansi Show output without ANSI codes
--help Show help banner of specified command