Reputation: 11
I installed cocoapods for an iOS project, but when I wrote this command pod setup --verbose
nothing happened, so I tried some other code but it got worse, and now when I setup cocoapods I get this error:
/Library/Ruby/Site/2.3.0/rubygems.rb:275:in `find_spec_for_exe': can't find gem cocoapods (>= 0.a) with executable pod (Gem::GemNotFoundException)
from /Library/Ruby/Site/2.3.0/rubygems.rb:252:in `bin_path'
from /usr/local/bin/pod:22:in `<main>'
Upvotes: 0
Views: 1963
Reputation: 755
I don't know what happened, but the usual procedure of installing Cocoapods and setting it up is as follows:
Installing Cocoapods
sudo gem install cocoapods
Initializing Xcode project for Cocoapods
cd
commandpod init
. This will add a Podfile to your project, which you can open and add the pods you want.pod install
. This will also generate a .xcworkspace
file along with your .xcodeproj
file, and you should always use the former from now on. With your situation where it seems like pod was either not installed or not installed properly, I suggest you try sudo gem uninstall cocoapods
first to remove everything that might be present, then follow the steps above. Also, if that fails, please check that you have the lastest version of Ruby installed.
Upvotes: 1