ios – Unable to install cocapods – mach-o file, but is an incompatible architecture (have ‘arm64’, need ‘x86_64’

0
27

[ad_1]

I am unable to install cocoapods on my mac. I use Mac OS Monterey. What do I need to do?
I try to install with: sudo gem install cocoapods
This is the error I get:

ERROR:  Loading command: install (LoadError)
    dlopen(/Library/Ruby/Gems/2.6.0/gems/date-3.3.3/lib/date_core.bundle, 0x0009): tried: '/Library/Ruby/Gems/2.6.0/gems/date-3.3.3/lib/date_core.bundle' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')) - /Library/Ruby/Gems/2.6.0/gems/date-3.3.3/lib/date_core.bundle
ERROR:  While executing gem ... (NoMethodError)
    undefined method `invoke_with_build_args' for nil:NilClass

[ad_2]