Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 526 Vote(s) - 3.48 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to run CocoaPods on Apple Silicon (M1)

#11
For updating pods, maybe someone will help:

After installing ffi:

sudo arch -x86_64 gem install ffi

Update dependencies

arch -x86_64 pod update
Reply

#12
I have a twist to this answer:

1. run

```
sudo gem install ffi
```

2. **the twist**: *I restarted my machine* and then it worked.
Reply

#13
Install cocoapods

sudo arch -x86_64 gem install ffi

Install pod file

arch -x86_64 pod install

Update pod

arch -x86_64 pod update

Reply

#14
As of version `1.10.1` Jan 7, 2021, CocoaPods is now supporting the new M1 chip.
Reply

#15
1. ***Execute*** below to ***install*** the required ***ffi*** :

`sudo arch -x86_64 gem install ffi`

2. Instead of `pod install` use :

`arch -x86_64 pod install`

Reply

#16
**Install pod in project without using rosetta terminal**
just follow below steps
- sudo arch -x86_64 gem install ffi
- arch -x86_64 pod install
Reply

#17
**IN MAC M1**, for anyone using KMM (Kotlin Multiplatform Mobile), but it may work for other, finding that it does not create files on the `.xcworkspace` for the iOS APP, when using CocoaPods as dependency manager, first install CocoaPods by typing

sudo gem install cocoapods

than navigate to your project folder, now on the iOS folder and type

sudo arch -x86_64 gem install ffi
arch -x86_64 pod install

Now you should find all the files in iOS workspace.
If you have problems with

/Users/$name/$directory/$projectName/$iosFolderName/$iosAppName.xcodeproj
The linked and embedded framework 'Pods_iosApp.framework' is missing one or more architectures required by this target: x86_64.

You need to add **arm64** to xCode, click on the project folder -> **Build Settings** -> and search for **Excluded Architectures** and add **arm64**
Reply

#18
### TL;DR:
- Install your own version of Ruby with Homebrew / rbenv / RVM (e.g. `brew install ruby`)
- Add it and the gems binaries to your `PATH` and make sure the new version is used with `which ruby` (should be `/opt/homebrew/opt/ruby/bin/ruby` instead of `/usr/bin/ruby` if installed with Homebrew)
- Install CocoaPods with `sudo gem install cocoapods` (make sure `ethon` is at least version 0.13.0)
- Run `pod install`

### Detailed answer:
All answers suggesting using Rosetta / `arch -x86_64` are workarounds and not quite solving the real issue that comes from the way RbConfig and the universal binaries work.

```rb
require 'rbconfig'

OSVERSION = RbConfig::CONFIG['host_os']
ARCH = RbConfig::CONFIG['arch']
HOSTCPU = RbConfig::CONFIG['host_cpu']
BUILDCPU = RbConfig::CONFIG['build_cpu']
TARGETCPU = RbConfig::CONFIG['target_cpu']

puts "OS: #{OSVERSION}"
puts "Arch: #{ARCH}"
puts "Host CPU: #{HOSTCPU}"
puts "Build CPU: #{BUILDCPU}"
puts "Target CPU: #{TARGETCPU}"
```

If you call `ruby` on a file containing this code with the universal binary shipped with macOS, you will get the following result on an M1 Mac:
```
OS: darwin20
Arch: universal-darwin20
Host CPU: x86_64
Build CPU: x86_64
Target CPU: universal
```
As you can see, RbConfig was compiled for a « universal » CPU but built with an x86 CPU, and the `rbconfig.rb` file that was generated (see `/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/universal-darwin20/rbconfig.rb`) consequently uses invalid information for the host CPU.

As `ffi` uses information from RbConfig (see

[To see links please register here]

and

[To see links please register here]

), we end up with OP’s error message.

The solution is, therefore, to get a version of Ruby built specifically for arm64 by using either Homebrew, rbenv or RVM.

For Homebrew:
- Execute `brew install ruby`
- Add `export PATH=/opt/homebrew/opt/ruby/bin:/opt/homebrew/lib/ruby/gems/3.0.0/bin:$PATH` to your `.zshrc` (you can find your Homebrew installation directory with `$(brew --prefix)` if needed)
- Execute `source ~/.zshrc` or restart your shell
- Make sure you are using the correct `ruby` binary by executing `which ruby` (should be `$(brew --prefix)/opt/ruby/bin/ruby`)
- Install CocoaPods with `sudo gem install cocoapods`
- Make sure you are using the correct `pod` binary by executing `which pod` (should be `$(brew --prefix)/lib/ruby/gems/3.0.0/bin/pod`)
- Make sure `ethon` is version 0.13.0 or more with `gem info ethon`, otherwise run `sudo gem install ethon`
- Run `pod install`

### Ruby won't come with future macOS versions by default
Moreover, it should be noted that `ruby` is still included in macOS only « for compatibility with legacy software », as evidenced by running `irb -v`, so this is probably a good opportunity to install your own version anyway:

> WARNING: This version of ruby is included in macOS for compatibility
> with legacy software. In future versions of macOS the ruby runtime
> will not be available by default and may require you to install an
> additional package.
>
> irb 1.0.0 (2018-12-18)


Sources:
-

[To see links please register here]

-

[To see links please register here]

Reply

#19
To install completely cocoapods on Mac with M1 chip (Apple Silicon), please follow these steps:

1. Duplicate the Terminal application in the Utilities folder.
2. Right-click on the app and choose to Get Info.
3. Rename the other version of the app as you like.
4. Check the option "open with Rosetta".
5. Install Cocoapods with the command "sudo gem install cocoapods"
6. Type the command line "gem install ffi" to fix the ffi bundle problem.
Now you can do a "pod install" without a problem.

Source : [iPhoneSoft][1]


[1]:

[To see links please register here]

Reply

#20
I had the same problem with my new MacBook Air M1 just because m1 has a different architecture we should install packages with [Rosetta Translation Environment][1].

You can solve most compatibilities by using rosetta.

# STEPS TO SOLVE:
1. Open finder/applications
2. Duplicate your terminal
3. Right-click the new terminal and check the checkbox
[x] open using


and then install packages with this terminal
[![enter image description here][2]][2]


[1]:

[To see links please register here]

[2]:
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through