Flutter Mac Book M1你似乎安装了CocoaPods,但它不起作用



仍未解决

我正在用M1芯片(Big Sur(在Mac Book上建立Android Studio

当编辑一个有依赖关系的项目时,我会得到一个Cocopod错误

我尝试重新安装并重新打开Android Studio,使用:

$ sudo gem install cocoapods

更新

遵循指南:在Apple Silicon(M1(上运行CocoaPods

我做了什么:

  • 在Finder中右键单击终端
  • 获取信息
  • 与罗塞塔公开赛
  • sudo arch-x86_64 gem安装ffi

直到这里没有错误消息

。然后我尝试(在项目的Android工作室与罗塞塔停用(

  • 重新安装依赖项arch-x86_64 pod安装

并得到以下错误:

Traceback (most recent call last):
5: from /usr/local/bin/pod:23:in `<main>'
4: from /usr/local/bin/pod:23:in `load'
3: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/bin/pod:55:in `<top (required)>'
2: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/command.rb:49:in `run'
1: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/command.rb:140:in `verify_minimum_git_version!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/command.rb:128:in `git_version': Failed to extract git version from `git --version` ("") (RuntimeError)

我的Ruby版本是:

which ruby
ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin20]

UPDATE 27.06我用另一个Ruby版本再次尝试,但仍然不起作用:

ruby 3.0.1p64(2021-04-05修订版0fb78ee38([arm64-darwin20]:Mac M1-Cocoapods不工作(Flutter(verify_minimum_git_version

位置:

ruby -v
/usr/bin/ruby


Content of .zshr file
export PATH="$PATH:/Users/timknogel/tools/flutter/bin"

rvm info
system:
system:
uname:        "Darwin Tims-MacBook-Pro.local 20.3.0 Darwin Kernel Version 20.3.0: Thu Jan 21 00:06:51 PST 2021; root:xnu-7195.81.3~1/RELEASE_ARM64_T8101 arm64"
name:         "OSX"
version:      "11.2"
architecture: "arm64"
bash:         "/bin/bash => GNU bash, version 3.2.57(1)-release (arm64-apple-darwin20)"
zsh:          "/bin/zsh => zsh 5.8 (x86_64-apple-darwin20.0)"
remote_path:  "osx/11.2/arm64"
xcode:        "12.5"
rvm:
version:      "1.29.12 (latest)"
updated:      "2 days 7 hours 56 minutes 14 seconds ago"
path:         "/Users/timknogel/.rvm"
autolibs:     "[4] Allow RVM to use package manager if found, install missing dependencies, install package manager (only OS X)."
homes:
gem:          "not set"
ruby:         "not set"
binaries:
ruby:         "/usr/bin/ruby"
irb:          "/usr/bin/irb"
gem:          "/usr/bin/gem"
rake:         "/usr/bin/rake"
environment:
PATH:         "/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Users/timknogel/tools/flutter/bin:/Users/timknogel/.rvm/bin"
GEM_HOME:     ""
GEM_PATH:     ""
MY_RUBY_HOME: ""
IRBRC:        ""
RUBYOPT:      ""
gemset:       ""

我的Git版本是:

%git版本git版本2.30.1(Apple git-130(

Flutter医生:

flutter doctor -v                           
[✓] Flutter (Channel stable, 2.2.1, on macOS 11.2.2 20D80 darwin-arm, locale en-ES)
• Flutter version 2.2.1 at /Users/timknogel/tools/flutter
• Framework revision 02c026b03c (7 days ago), 2021-05-27 12:24:44 -0700
• Engine revision 0fdb562ac8
• Dart version 2.13.1
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /Users/timknogel/Library/Android/sdk
• Platform android-30, build-tools 30.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
• All Android licenses accepted.
[!] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.5, Build version 12E262
✗ CocoaPods installed but not working.
You appear to have CocoaPods installed but it is not working.
This can happen if the version of Ruby that CocoaPods was installed with is different from the one being used to invoke it.
This can usually be fixed by re-installing CocoaPods.
To re-install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.
[✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] Android Studio (version 4.2)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
[!] Connected device
! No devices available
! Doctor found issues in 3 categories.
ruby -v
ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.arm64e-darwin20]

此错误似乎是与GIT相关的持续问题。

您可以尝试运行git --version并检查它是否返回有效的git版本。如果仍然不起作用,请运行brew install git。否则,这就是这个问题的另一个例子,它仍然是开放的atm。

最新更新