Pod コマンド実行時に "Ignoring ffi-1.14.2 because its extensions are not built." エラーが出る


問題

Swift でのアプリ作成時、pod initを実行したら以下のエラーが出た

terminal
$ pod init                             
Ignoring ffi-1.14.2 because its extensions are not built.
Try: gem pristine ffi --version 1.14.2

提案通りgem pristine ffi --version 1.14.2を試すがうまくいかなかった

terminal
$ sudo gem pristine ffi --version 1.14.2
ERROR:  While executing gem ... (Gem::Exception)
    Failed to find gems ["ffi"] = 1.14.2

解決策

以下のコマンドで解決した

terminal
$ sudo gem install ffi -v '1.14.2'

Fetching ffi-1.14.2.gem
Building native extensions. This could take a while...
Successfully installed ffi-1.14.2
Parsing documentation for ffi-1.14.2
Installing ri documentation for ffi-1.14.2
Done installing documentation for ffi after 30 seconds
1 gem installed