Cocoapods安装错误

60

我正在尝试在我的项目中安装CocoaPods,但总是会出现错误。

/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.35.0/lib/cocoapods/user_interface/error_report.rb:103: warning: Insecure world writable dir /usr/local in PATH, mode 040777
/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/CravenJM/.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>'

有没有任何想法是什么或者我该如何修复它?我需要使用CocoaPods来开发一个应用,但这真是一场噩梦 :-)


1
看起来CravenJM的个人资料是为了提出这个问题而创建的... - Micky
1个回答

224

我在新的Mac电脑上出现了同样的错误,因为我忘记在安装CocoaPods后运行“pod setup”。因此,specs仓库丢失,导致“pod install”命令失败。


78
“Forgot”可能不太准确,因为 CocoaPods 指南并没有真正告诉你一定要这么做。 - Micky
2
@Siten 运行 "sudo rm -fr ~/.cocoapods/repos/master",然后再次运行 pod setup,最后运行 pod install。 - libra
2
你会认为他们的指示现在应该有一个修复。 - Jargen89
1
@Kim非常感谢你。我已经被这个问题困扰了两次...显然他们计划很快发布一个版本来解决这个问题。 - Ross Henderson
3
接受这个答案吧,求求你了! - Sljux
显示剩余2条评论

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接