ioscocoapods

CocoaPods not installing


What does it mean and how can I fix it:

pod install
/Library/Ruby/Site/2.0.0/rubygems.rb:250:in `find_spec_for_exe': can't find gem cocoapods (>= 0.a) (Gem::GemNotFoundException)
from /Library/Ruby/Site/2.0.0/rubygems.rb:278:in `activate_bin_path'
from /usr/local/bin/pod:22:in `<main>'

Solution

  • Using following commands, it worked for me.

    1. sudo gem uninstall cocoapods
    2. sudo gem install -n /usr/local/bin cocoapods
    3. cocoapods pod install

    If you encounter this error on step 2:

    ERROR: While executing gem ... (Gem::CommandLineError) Please specify at least one gem name (e.g. gem build GEMNAME)

    Then try this as step 2 instead (step 3 is not needed):

    gem install -n /usr/local/bin cocoapods