ruby Pod安装在React Native和Mac M2时在glog时失败

qco9c6ql  于 2023-08-04  发布在  Ruby
关注(0)|答案(1)|浏览(146)

我的问题

我两周前买了MacBook Pro M2,从那以后,我就无法在我的React Native应用程序中安装Pod了。(我已经使用React Native一年多了,在M1上没有问题)。
当我运行命令cd ios && pod install时,错误就开始了,当它到达glog pod时,我总是得到一个错误。

我的目标

我想运行npm run ios(就像我以前的mac一样),并在iOS模拟器中安装/运行应用程序。

我所尝试的

在过去的2-3周里,我一直在安装和重新安装Node,Ruby,Bundler,Xcode,命令行工具...我已经尝试了从github和堆栈溢出问题的所有方法,但没有一个对我有效,我真的很绝望,似乎没有任何工作。

抛出错误的命令

cd ios && pod install

错误(汇总)

-> Installing boost (1.76.0)
  > Copying boost from
  `/Users/jvegax/Library/Caches/CocoaPods/Pods/External/boost/909665deed38b6f25051fac8c534aa3c-57d28` to `Pods/boost`

-> Installing fmt (6.2.1)
  > Copying fmt from `/Users/jvegax/Library/Caches/CocoaPods/Pods/Release/fmt/6.2.1-ff9d5` to `Pods/fmt`

-> Installing glog (0.3.5)
 > Git download
 > Git download
     $ /opt/homebrew/bin/git clone https://github.com/google/glog.git
     /var/folders/tn/v1qdr5nj7g75l5fj9qzx9px80000gn/T/d20230702-30759-hefom7 --template= --single-branch --depth 1
     --branch v0.3.5
Cloning into '/var/folders/tn/v1qdr5nj7g75l5fj9qzx9px80000gn/T/d20230702-30759-hefom7'...
Note: switching to 'a6a166db069520dbbd653c97c2e5b12e08a8bb26'.

You are in a 'detached HEAD' state. You can look around, make experimental changes and commits, and you can discard any commits you make in this state without impacting any branch by performing another checkout.

If you want to create a new branch to retain commits you create, you can do so (now or later) with the checkout command using -c. For example:

   git switch -c <new-branch-name>

Or undo the operation with:

   git switch -

Turn off this advice by setting the advice.detachedHead configuration variable to false.

[!] Error installing glog
  CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only performed in repo update

字符串

React Native信息

System:
  OS: macOS 13.4.1
  CPU: (8) arm64 Apple M2
  Memory: 95.67 MB / 8.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 18.16.1
    path: /usr/local/bin/node
  Yarn:
    version: 1.22.19
    path: /opt/homebrew/bin/yarn
  npm:
    version: 9.6.7
    path: /opt/homebrew/bin/npm
  Watchman:
    version: 2023.06.26.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.12.1
    path: /Users/jvegax/.rbenv/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 22.4
      - iOS 16.4
      - macOS 13.3
      - tvOS 16.4
      - watchOS 9.4
  Android SDK: Not Found
IDEs:
  Android Studio: 2022.2 AI-222.4459.24.2221.10121639
  Xcode:
    version: 14.3.1/14E300c
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 11.0.19
    path: /usr/bin/javac
  Ruby:
    version: 2.7.6
    path: /Users/jvegax/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react: Not Found
  react-native: Not Found
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

~/.zprofile

eval "$(/opt/homebrew/bin/brew shellenv)"

export ANDROID_SDK_ROOT="/Users/jvegax/Library/Android/sdk"
export ANDROID_PLATFORM_TOOLS="$ANDROID_SDK_ROOT/platform-tools"
export ANDROID_TOOLS="$ANDROID_SDK_ROOT/tools"
export ANDROID_TOOLS_BIN="$ANDROID_TOOLS/bin"
export ANDROID_BUILD_TOOLS="$ANDROID_SDK_ROOT/build-tools/33.0.0" #edit according to sdk version

path=(
  $ANDROID_TOOLS
  $ANDROID_SDK_ROOT
  $ANDROID_TOOLS_BIN
  $ANDROID_PLATFORM_TOOLS
  $ANDROID_BUILD_TOOLS
  $path
)

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion
eval "$(rbenv init -)"

~/.zshrc

eval "$(/opt/homebrew/bin/brew shellenv)"

# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"

ZSH_THEME="gozilla"

source $ZSH/oh-my-zsh.sh

export ANDROID_SDK_ROOT="/Users/jvegax/Library/Android/sdk"
export ANDROID_PLATFORM_TOOLS="$ANDROID_SDK_ROOT/platform-tools"
export ANDROID_TOOLS="$ANDROID_SDK_ROOT/tools"
export ANDROID_TOOLS_BIN="$ANDROID_TOOLS/bin"
export ANDROID_BUILD_TOOLS="$ANDROID_SDK_ROOT/build-tools/33.0.0" #edit according to sdk version

path=(
  $ANDROID_TOOLS
  $ANDROID_SDK_ROOT
  $ANDROID_TOOLS_BIN
  $ANDROID_PLATFORM_TOOLS
  $ANDROID_BUILD_TOOLS
  $path
)

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion
eval "$(rbenv init -)"

cunj1qz1

cunj1qz11#

也许你已经试过了,但是你有没有试过删除podfile.lock来删除旧的pods,然后重新安装所有的东西
pod disintegrate pod setup pod install

相关问题