Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cocoa Pods 'No such file or Directory' Error

I have an IOS project that uses cocoapods. After switching computers and updating the OS on the new computer I am getting the following error when I try running "pod update"

Robbys-iMac-454:ios-v2 robbykmyers$ pod update
Update all pods
Analyzing dependencies
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/pathname.rb:422:in `open': No such file or directory - /Users/robbykmyers/.cocoapods/repos (Errno::ENOENT)
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/pathname.rb:422:in `foreach'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/pathname.rb:422:in `children'
    from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.35.0/lib/cocoapods/sources_manager.rb:63:in `all'
    from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.35.0/lib/cocoapods/user_interface/error_report.rb:130:in `repo_information'
    from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.35.0/lib/cocoapods/user_interface/error_report.rb:34:in `report'
    from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.35.0/lib/cocoapods/command.rb:58:in `report_error'
    from /Library/Ruby/Gems/2.0.0/gems/claide-0.7.0/lib/claide/command.rb:300:in `handle_exception'
    from /Library/Ruby/Gems/2.0.0/gems/claide-0.7.0/lib/claide/command.rb:274:in `rescue in run'
    from /Library/Ruby/Gems/2.0.0/gems/claide-0.7.0/lib/claide/command.rb:264:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.35.0/lib/cocoapods/command.rb:45:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.35.0/bin/pod:43:in `<top (required)>'
    from /usr/bin/pod:23:in `load'
    from /usr/bin/pod:23:in `<main>'

Does anyone know how to solve this?

like image 981
Rmyers Avatar asked Jan 01 '15 02:01

Rmyers


2 Answers

  1. Delete the folder ~/.cocoapods/ with rm -rf ~/.cocoapods

  2. Enter pod setup command in Terminal.

This process will take time as this command clones the CocoaPods Specs repository into ~/.cocoapods/ on your computer.

like image 200
Shamsudheen TK Avatar answered Oct 19 '22 09:10

Shamsudheen TK


It sometimes occurs when using a wrong apostrophe character in a Podfile or in a Podspec

enter image description here

Those apostrophes are default when using standard TextEdit app on OS X. I prefer Sublime Text to avoid such errors

like image 34
Tim Avatar answered Oct 19 '22 11:10

Tim