2015-01-01 116 views
10

我有一個使用cocoapods的IOS項目。在新計算機上切換計算機和更新OS後,我收到的時候我嘗試運行「莢更新」下面的錯誤可可豆莢'沒有這樣的文件或目錄'錯誤

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>' 

有誰知道如何解決這個問題?

回答

19
  1. 刪除文件夾~/.cocoapods/rm -rf ~/.cocoapods

  2. 在終端中輸入命令pod setup

這個過程需要一定的時間,因爲這命令克隆CocoaPods Specs庫到~/.cocoapods/您的計算機上。

+1

我其實並不需要刪除的文件,我解決它通過運行「寶d設置「。感謝您的迴應! – Rmyers

+0

我仍然有問題...!指導我解決錯誤 – Siten

+0

正在運行pod setup適合我!謝謝!!! – Christian

2

它有時在Podfile或在Podspec使用錯誤的撇號字符時

enter image description here

那些使用撇在OS X上的標準文本編輯應用程序時都默認我更崇高的文本,以避免此類錯誤發生

相關問題