Skip to content

Use brew install cocoapods instead of arch -x86_64 pod install on M1 MacBook #3003

Closed
@bangseongbeom

Description

@bangseongbeom

To solve the pod install issue on the M1 MacBook, #2974 suggests arch -x86_64 pod install command. You can also find it in a CocoaPods issue.

However, this approach is inappropriate. You may receive the following warnings when you run arch -x86_64 pod install:

facebook/react-native#33017

[!] Do not use "pod install" from inside Rosetta2 (x86_64 emulation on arm64).

[!] - Emulated x86_64 is slower than native arm64

[!] - May result in mixed architectures in rubygems (eg: ffi_c.bundle files may be x86_64 with an arm64 interpreter)

[!] Run "env /usr/bin/arch -arm64 /bin/bash --login" then try again.

This is a Ruby problem built in macOS. The built-in Ruby has been deprecated since Catalina (10.15), so you'll have to find another way.

Solution

brew install cocoapods internally downloads a Ruby suitable for the M1 MacBook.

The whole method I'd like to suggest is:

  1. brew install cocoapods
  2. pod install

instead of:

  1. sudo gem install cocoapods
  2. sudo arch -x86_64 gem install ffi
  3. arch -x86_64 pod install

See also

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions