2018-04-26

升级到新Xcode9.3后,新项目集成CocoaPods报错

执行pod init 报错

### Error
RuntimeError - [Xcodeproj] Unknown object version.
/Library/Ruby/Gems/2.3.0/gems/xcodeproj-1.5.3/lib/xcodeproj/project.rb:217:in `initialize_from_file'
/Library/Ruby/Gems/2.3.0/gems/xcodeproj-1.5.3/lib/xcodeproj/project.rb:102:in `open'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.4.0.beta.2/lib/cocoapods/command/init.rb:41:in `validate!'
/Library/Ruby/Gems/2.3.0/gems/claide-1.0.2/lib/claide/command.rb:333:in `run'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.4.0.beta.2/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.4.0.beta.2/bin/pod:55:in `'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `
'

解决方法:

首先执行 gem install cocoapods --pre
如果报错 You don't have write permissions for the /usr/bin directory.

再执行

sudo gem install -n /usr/local/bin sass 
sudo gem install -n /usr/local/bin cocoapods

over

你可能感兴趣的:(2018-04-26)