CocoaPods not working in macOS High Sierra

Maciej Swic picture Maciej Swic · Jun 6, 2017 · Viewed 55k times · Source

After upgrading to macOS High Sierra CocoaPods is not working. While it is tempting to move away from CocoaPods, it's unfortunately not in scope right now. The error message is below.

zsh: /Users/****/.gems/bin/pod: bad interpreter: /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin: no such file or directory

I realize that the error stems from Ruby being upgraded but what is the easies fix? Trying to make CocoaPods use the new ruby version yields other errors.

Edit: For now i installed Ruby 2.0 with rvm install 2.0.0 and rvm use 2.0.0 and then reinstalled CocoaPods sudo gem install cocoapods. Seems to be working now.

Answer

zeisi picture zeisi · Jun 6, 2017

According to https://github.com/CocoaPods/CocoaPods/issues/6778 reinstalling CocoaPods should solve this issue:

sudo gem install cocoapods