🚀はじめに
先日M1Proチップ搭載のMacを調達したのですが、そこでcocoaPodsのインストールができなく結構苦戦してしまい貴重な休日の勉強時間を削られてしまったので、
同じようなエラーが出ている人がサクッと開発に取り組めるようにこの記事を執筆します。
💥発生したエラー
エラーは全てのライブラリをインストールする時に現れるわけではなく、インストールできないライブラリとできるライブラリが存在したので余計解決を拗らせました。
実際に出たログはこちらです。
[!] Oh no, an error occurred.
Search for existing GitHub issues similar to yours:
https://github.com/CocoaPods/CocoaPods/search?q=xx
If none exists, create a ticket, with the template displayed above, on:
https://github.com/CocoaPods/CocoaPods/issues/new
Be sure to first read the contributing guide for details on how to properly submit a ticket:
https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md
Don't forget to anonymize any private data!
Looking for related issues on cocoapods/cocoapods...
Searching for inspections failed: undefined method `map' for nil:NilClass
こんな感じです。
こちらの解決方法はこの方の記事がとても参考になりますでの、ご参照ください。
💥今回解決していくメインエラー
しかし、こちらの記事の最後のpod install
を実行するとエラーが出て正常にインストールが走ることはありませんでした。
ログがこちらです。
[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.
原因は詳しいことは分かりませんでしたが
rbenvで落としたバージョンが原因ようでしたので同じようなIssueを報告していた方がいたようなので参考にさせていただきました。
arch -x86_64 sudo gem install cocoapods
arch -x86_64 sudo gem install ffi
arch -x86_64 pod install
こちらで解決できました🦊
M1が直接的に関係しているのか分かりませんでしたがIntelチップでは発生しなかったのでおそらく何がが引っかかったのでしょう。。