1

I am following a tutorial to create an IOS app using a Google Maps with cocoa pods.

The command pod install crashes. I am thinking of a env problem because the command pod env crashes...

I have tried to open an issue on cocoa github but they as closed it immediately as "not an issue of cocoa pods" without giving any help...

I have tried to reinstall homebrew, ruby, xcode command tools line as I have seen it on some posts.

➜  ~ which ruby
/opt/homebrew/opt/ruby/bin/ruby
➜  ~ ruby -v
ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [arm64-darwin21] 

Here is the log trace

➜  ~ pod env              
/Library/Ruby/Gems/2.6.0/gems/ethon-0.15.0/lib/ethon/curls/classes.rb:36: [BUG] Illegal instruction at 0x00000001041ec000
ruby 2.6.8p205 (2021-07-07 revision 67951) [universal.arm64e-darwin21]

-- Crash Report log information --------------------------------------------
   See Crash Report log file under the one of following:                    
     * ~/Library/Logs/DiagnosticReports                                     
     * /Library/Logs/DiagnosticReports                                      
   for more details.                                                        
Don't forget to include the above Crash Report log file in bug reports.     

-- Control frame information -----------------------------------------------
c:0044 p:---- s:0260 e:000259 CFUNC  :getdtablesize
c:0043 p:0050 s:0256 e:000255 CLASS  /Library/Ruby/Gems/2.6.0/gems/ethon-0.15.0/lib/ethon/curls/classes.rb:36
c:0042 p:0075 s:0253 e:000252 CLASS  /Library/Ruby/Gems/2.6.0/gems/ethon-0.15.0/lib/ethon/curls/classes.rb:27
c:0041 p:0007 s:0250 e:000249 CLASS  /Library/Ruby/Gems/2.6.0/gems/ethon-0.15.0/lib/ethon/curls/classes.rb:3
c:0040 p:0007 s:0247 e:000246 TOP    /Library/Ruby/Gems/2.6.0/gems/ethon-0.15.0/lib/ethon/curls/classes.rb:2 [FINISH]
c:0039 p:---- s:0244 e:000243 CFUNC  :require
c:0038 p:0110 s:0239 e:000238 METHOD /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54
c:0037 p:0128 s:0227 e:000226 CLASS  /Library/Ruby/Gems/2.6.0/gems/ethon-0.15.0/lib/ethon/curl.rb:29
c:0036 p:0007 s:0224 e:000223 CLASS  /Library/Ruby/Gems/2.6.0/gems/ethon-0.15.0/lib/ethon/curl.rb:14
c:0035 p:0049 s:0221 e:000220 TOP    /Library/Ruby/Gems/2.6.0/gems/ethon-0.15.0/lib/ethon/curl.rb:9 [FINISH]
c:0034 p:---- s:0218 e:000217 CFUNC  :require
c:0033 p:0110 s:0213 e:000212 METHOD /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54
c:0032 p:0049 s:0201 e:000200 TOP    /Library/Ruby/Gems/2.6.0/gems/ethon-0.15.0/lib/ethon.rb:16 [FINISH]
c:0031 p:---- s:0198 e:000197 CFUNC  :require
c:0030 p:0110 s:0193 e:000192 METHOD /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54
c:0029 p:0013 s:0181 e:000180 TOP    /Library/Ruby/Gems/2.6.0/gems/typhoeus-1.4.0/lib/typhoeus.rb:2 [FINISH]
c:0028 p:---- s:0178 e:000177 CFUNC  :require
c:0027 p:0110 s:0173 e:000172 METHOD /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54
c:0026 p:0006 s:0161 e:000160 METHOD /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/cdn_source.rb:440
c:0025 p:0045 s:0153 e:000152 METHOD /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/cdn_source.rb:372
c:0024 p:0318 s:0142 e:000141 METHOD /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/cdn_source.rb:365
c:0023 p:0006 s:0132 e:000131 METHOD /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/cdn_source.rb:338
c:0022 p:0059 s:0127 e:000126 METHOD /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/cdn_source.rb:53
c:0021 p:0021 s:0123 e:000122 METHOD /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source.rb:31
c:0020 p:0030 s:0118 e:000117 METHOD /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/cdn_source.rb:30 [FINISH]
c:0019 p:---- s:0113 e:000112 CFUNC  :new
c:0018 p:0068 s:0108 e:000104 BLOCK  /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:315 [FINISH]
c:0017 p:0039 s:0100 E:0005a8 METHOD /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:322
c:0016 p:0007 s:0093 e:000092 BLOCK  /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:331 [FINISH]
c:0015 p:---- s:0089 e:000088 CFUNC  :map
c:0014 p:0006 s:0085 e:000084 METHOD /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:331
c:0013 p:0008 s:0079 e:000078 METHOD /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:26
c:0012 p:0004 s:0075 e:000074 METHOD /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:60
c:0011 p:0016 s:0071 e:000070 METHOD /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/user_interface/error_report.rb:173
c:0010 p:0070 s:0067 e:000051 METHOD /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/user_interface/error_report.rb:77
c:0009 p:0012 s:0045 e:000044 METHOD /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/command/env.rb:38
c:0008 p:0006 s:0041 e:000039 METHOD /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/command/env.rb:26
c:0007 p:0011 s:0036 e:000034 METHOD /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/command/env.rb:20
c:0006 p:0078 s:0031 e:000030 METHOD /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334
c:0005 p:0024 s:0024 e:000023 METHOD /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/command.rb:52
c:0004 p:0378 s:0019 e:000018 TOP    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/bin/pod:55 [FINISH]
c:0003 p:---- s:0013 e:000012 CFUNC  :load
c:0002 p:0109 s:0008 E:000cc0 EVAL   /usr/local/Cellar/cocoapods/1.11.2_1/libexec/bin/pod:23 [FINISH]
c:0001 p:0000 s:0003 E:000770 (none) [FINISH]

-- Ruby level backtrace information ----------------------------------------
/usr/local/Cellar/cocoapods/1.11.2_1/libexec/bin/pod:23:in `<main>'
/usr/local/Cellar/cocoapods/1.11.2_1/libexec/bin/pod:23:in `load'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/bin/pod:55:in `<top (required)>'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/command/env.rb:20:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/command/env.rb:26:in `report'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/command/env.rb:38:in `stack'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/user_interface/error_report.rb:77:in `stack'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/user_interface/error_report.rb:173:in `repo_information'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:60:in `all'

[...]

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: https://www.ruby-lang.org/bugreport.html

[IMPORTANT]
Don't forget to include the Crash Report log file under
DiagnosticReports directory in bug reports.

[1]    19216 abort      pod env

PS : I am on Mac M1 version 12.0.1 and Xcode 13.1

M. Zhang
  • 750
  • 8
  • 18
Gaugautier
  • 21
  • 2

1 Answers1

0

OK so the solution is following:

  1. I enabled Rosetta for the Terminal app. (Don't forget to re-open the app afterwards.) I don't know if this is step is necessary but I did it like that and it worked so if you skip this step and the following steps are not working, try also this one

Enable Rosetta for the Terminal app

  1. Install ffi

    sudo arch -x86_64 gem install ffi
    
  2. Re-install dependencies

    arch -x86_64 pod install
    

The original solution is here: How to running CocoaPods on Apple Silicon (M1)

samuelg0rd0n
  • 1,080
  • 2
  • 15
  • 27