# LoadError - dlopen(ffi_c.bundle) (LoadError) incompatible architecture (have 'x86_64', need 'arm64e')

**Code:** `CocoaPods: ffi / ruby error on Apple silicon` · **Category:** iOS · **Seen on:** iOS, macOS

CocoaPods' native gem was built for another CPU architecture.

## Meaning

Reinstall CocoaPods under the Ruby you use now (`gem install cocoapods` or `brew install cocoapods`), or run Terminal under Rosetta consistently. Avoid mixing arm64 and x86_64 Ruby.

## Common causes

- Rosetta/arm64 mix
- Old system Ruby gems
- Homebrew migrated

## Quick fix

1. `sudo gem install ffi` or `brew reinstall cocoapods`
2. Use rbenv with arm64 Ruby
3. Reopen terminal without Rosetta

## Detailed fix by platform

### Shell

1. 

```swift
brew reinstall cocoapods
pod --version
```


## How to diagnose

1. **Arch** — arm64/x86?
2. **Ruby** — which?
3. **Gems** — rebuilt?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/ios/cocoapods-ffi-bundler-ruby-error)
