我想试试颤栗。flutter doctor
告诉我我需要CocoaPods:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.8.1, on macOS 11.6.1 20G224 darwin-x64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
[!] Xcode - develop for iOS and macOS (Xcode 13.2.1)
✗ CocoaPods not installed.
CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to
your plugin usage on the Dart side.
Without CocoaPods, plugins will not work on iOS or macOS.
For more info, see https://flutter.dev/platform-plugins
To install see https://guides.cocoapods.org/using/getting-started.html#installation for
instructions.
[✓] Chrome - develop for the web
[✓] Android Studio (version 2020.3)
[✓] Connected device (1 available)
! Doctor found issues in 1 category.
好的,我只需要CocoaPods!
我去了https://guides.cocoapods.org/using/getting-started.html#installation,第一次尝试了这个:
sudo gem install cocoapods
这将返回一条错误消息:
ERROR: Could not find a valid gem 'cocoapods' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://api.rubygems.org/specs.4.8.gz)
接下来,我尝试了这种没有sudo的安装。我打开了我的.bash_profile
并添加了两行:
export GEM_HOME=$HOME/.gem
export PATH=$GEM_HOME/bin:$PATH
然后我再次运行gem install cocoapods
,没有sudo
gem install cocoapods
这将返回相同的错误消息:
ERROR: Could not find a valid gem 'cocoapods' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://api.rubygems.org/specs.4.8.gz)
我检查了rvm
,它似乎安装正确:
rvm -v
rvm 1.26.11 (latest) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]
我不知道server certificate B
是什么,也不知道如何修复它。我现在该干啥?
发布于 2021-12-20 20:09:50
这样做是有效的:
rvm osx-ssl-certs update all
它更新了Ruby认证。然后我必须更新Ruby,然后我安装了CocoaPods。我没有使用sudo
,而是在.bash_profile
中安装了CocoaPods的路径
# for Cocoapods
export GEM_HOME=$HOME/.gem
export PATH=$GEM_HOME/bin:$PATH
然后我安装了CocoaPods:
gem install cocoapods
我运行了flutter doctor
flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.8.1, on macOS 11.6.1 20G224 darwin-x64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2020.3)
[✓] Connected device (1 available)
耶!
https://stackoverflow.com/questions/70426327
复制