I was facing the same issue but this command has fixed issue for me.
Try this command and hopefully you will be able to resolve your issue.
sudo gem install -n /usr/local/bin cocoapods -v 1.8.4
Topic:
App & System Services
SubTopic:
Core OS
Tags: