user18124547
user18124547

Reputation:

How can solve this problem? Error: To set up CocoaPods for ARM macOS, run: arch -x86_64 sudo gem install ffi

Updated context:

When I tried to run flutter project, but I got the this error Error: To set up CocoaPods for ARM macOS, run: arch -x86_64 sudo gem install ffi

I'd run arch -x86_64 sudo gem install ffi, but still had same issues.

this is information

yomate@Mac-mini yomate % sudo gem install ffi
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/universal-darwin21/rbconfig.rb:230: warning: Insecure world writable dir /Users/yomate/FlutterDev/flutter/bin in PATH, mode 040777
Building native extensions. This could take a while...
Successfully installed ffi-1.15.5
Parsing documentation for ffi-1.15.5
Done installing documentation for ffi after 3 seconds
1 gem installed

How can solve this problem? arch: posix_spawnp: gem: Bad CPU type in executable , environment: Mini M1

When I want to use this commend

sudo arch -x86_64 gem install ffi and sudo arch -x86_64 gem install cocoapods

I had got this error. arch: posix_spawnp: gem: Bad CPU type in executable

And my flutter still had error.

[!] Flutter (Channel stable, 3.0.1, on macOS 12.4 21F79 darwin-arm, locale
    en-AU)
    ✗ Downloaded executables cannot execute on host.
      See https://github.com/flutter/flutter/issues/6207 for more information

Upvotes: 11

Views: 13230

Answers (3)

just simple install cocoapods with brew brew install cocoapods

Upvotes: 5

mikezamayias
mikezamayias

Reputation: 1

I was getting the same message on a fresh install of macOS 12.4 on a M1 MBA,

Downloaded executables cannot execute on host.
See https://github.com/flutter/flutter/issues/6207 for more information

Turns out Rosetta wasn't installed yet (I'm guessing the transition to Apple Silicon is almost complete then? haha), and once I installed it the warning went away.

Upvotes: 0

Francesco Iapicca
Francesco Iapicca

Reputation: 2657

try with this
sudo gem uninstall ffi && sudo gem install ffi -- --enable-libffi-alloc
source

Upvotes: 13

Related Questions