V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
iOS 开发实用技术导航
NSHipster 中文版
http://nshipster.cn/
cocos2d 开源 2D 游戏引擎
http://www.cocos2d-iphone.org/
CocoaPods
http://cocoapods.org/
Google Analytics for Mobile 统计解决方案
http://code.google.com/mobile/analytics/
WWDC
https://developer.apple.com/wwdc/
Design Guides and Resources
https://developer.apple.com/design/
Transcripts of WWDC sessions
http://asciiwwdc.com
Cocoa with Love
http://cocoawithlove.com/
Cocoa Dev Central
http://cocoadevcentral.com/
NSHipster
http://nshipster.com/
Style Guides
Google Objective-C Style Guide
NYTimes Objective-C Style Guide
Useful Tools and Services
Charles Web Debugging Proxy
Smore
banxi1988
V2EX  ›  iDev

第一次使用 pod 遇到总是 Google 一圈无果

  •  
  •   banxi1988 ·
    banxi1988 · 2014-05-21 12:20:24 +08:00 · 3573 次点击
    这是一个创建于 3651 天前的主题,其中的信息可能已经有所发展或是发生改变。
    RT:
    无论是运行pod install
    还是直接运行pod提示下面的错误,
    在官网的 http://guides.cocoapods.org/using/troubleshooting.html
    没有找到 答案,SO 有个类似的总是没有答案还被-1了。

    ➜ ~ pod
    Setting up CocoaPods master repo
    [!] /usr/bin/git clone 'https://github.com/CocoaPods/Specs.git' master --depth=1

    fatal: could not create work tree dir 'master'.: Permission denied

    /Library/Ruby/Gems/2.0.0/gems/claide-0.6.1/lib/claide/command.rb:304:in `handle_exception': undefined method `verbose?' for nil:NilClass (NoMethodError)
    from /Library/Ruby/Gems/2.0.0/gems/claide-0.6.1/lib/claide/command.rb:284:in `rescue in run'
    from /Library/Ruby/Gems/2.0.0/gems/claide-0.6.1/lib/claide/command.rb:274:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.33.1/lib/cocoapods/command.rb:48:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.33.1/bin/pod:33:in `<top (required)>'
    from /usr/bin/pod:23:in `load'
    from /usr/bin/pod:23:in `<main>'
    ➜ ~

    ruby版本:
    ➜ ~ ruby -v
    ruby 2.0.0p451 (2014-02-24 revision 45167) [universal.x86_64-darwin13]
    ➜ ~
    应该不是这样总是吧。
    4 条回复    2014-05-24 10:46:07 +08:00
    nagato
        1
    nagato  
       2014-05-21 12:21:14 +08:00   ❤️ 1
    sudo pod install
    dorentus
        2
    dorentus  
       2014-05-21 13:14:35 +08:00   ❤️ 1
    pod master repo 的路径是 ~/.cocoapods/repos/master,在你的用户主目录下,报错的话,估计是你之前用 sudo 运行过 pod,把权限覆盖了吧……

    继续用 sudo pod 估计也可以,不过我个人不推荐在没必要的时候用 sudo。
    sudo chown -R `whoami` ~/.cocoapods 修复下权限;如果再不行的话,
    直接 sudo rm -rf ~/.cocoapods 把它删掉,然后不用 sudo 来执行 pod setup 让它重建吧。
    banxi1988
        3
    banxi1988  
    OP
       2014-05-21 15:31:51 +08:00
    @dorentus
    谢谢,之前我查看
    http://guides.cocoapods.org/using/troubleshooting.html
    也用了以下命令:
    $ sudo rm -fr ~/Library/Caches/CocoaPods/
    $ sudo rm -fr ~/.cocoapods/repos/master/
    $ sudo rm -fr Pods/
    但是还是不行,
    按你说的更直接一点将整个.cocoapods删除就OK了。
    非常感谢。
    parkman
        4
    parkman  
       2014-05-24 10:46:07 +08:00
    权限问题 哈哈
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2286 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 12:43 · PVG 20:43 · LAX 05:43 · JFK 08:43
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.