In a recently purchased Apple Mac Mini, I proceeded to setup my iOS and Mac OS X developer tools & documentation. Although the tools installed fine and I could carry on working with my existing projects, when I choose to install Cocoapods, I encountered the following error –
The nature of the error suggested an issue with the path of Xcode. A quick search in Google revealed a number of useful posts in Stackoverflow, the most relevant post suggested using xcode-select to force the correct path of Xcode.app to be used for Cocoapods installation. I proceeded to install the command line tools for Xcode followed by xcode-select and attempted to install Cocoapods. This time, the Cocoapods installation was quick and successful –
Hope this helps someone else!