This is the short version:
When I run
pod install
in an Xcode project I get
[!] Pod::Executable pull erro
Quick, easy, hacky solution:
sudo chmod -R 777 ~/.cocoapods
sudo chmod -R 777 ~/Library/Caches/CocoaPods
The issue is with Mac OS X's default installation of Ruby. The Ruby/Gems installation is owned by root in the location you specified.
This is normal behavior unless you install a Ruby manager. I would recommend rbenv but RVM is popular as well.
These installed your Ruby installation in your $HOME
folder. This way your user owns the Ruby and gem executables.
This is a known issue. There's more on the CocoaPods official web-site.
Answering the original question:
Is sudo installation of cocoaPods the wrong way or normal way?
When I do a pod install
I get:
Analyzing dependencies
CocoaPods 0.36.0.beta.1 is available.
To update use: `sudo gem install cocoapods --pre`
so I assume sudo
is OK.