由于react-native
升级到0.42.0,报错:jschelpers/JavaScriptCore.h file not found
,根据相关github issues反馈,需将cocoapods
升级到1.2.0
- 执行升级cocoapods之后:
sudo gem install cocoapods -v 1.2.0
报错:
ERROR: Could not find a valid gem 'cocoapods' (= 1.2.0) in any repository
ERROR: While executing gem ... (OpenSSL::SSL::SSLError)
hostname "upyun.gems.ruby-china.org" does not match the server certificate
- 在想是不是需要升级下gem,于是执行:
sudo gem update --system
报错:
ERROR: While executing gem ... (OpenSSL::SSL::SSLError)
hostname "upyun.gems.ruby-china.org" does not match the server certificate
- 看来是源路径的问题,修改源路径:
gem sources --remove https://ruby.taobao.org/
gem sources -a https://gems.ruby-china.org
gem更新成功
- 更新cocoapod:
sudo gem install cocoapods
报错:
ERROR: While executing gem ... (Errno::EPERM)
Operation not permitted - /usr/bin/xcodeproj
于是修改语句为:
sudo gem install -n /usr/local/bin cocoapods --pre
升级成功