Pod安装命令有错误

时间:2015-06-19 09:05:02

标签: ios xcode cocoapods

我一直在尝试使用cocoapods并将它们安装到我的项目中,但在尝试将其安装到项目位置时会给我这个错误。它有点令人困惑?

/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.37.2/lib/cocoapods/command.rb:127: warning: Insecure world writable dir /usr/local in PATH, mode 040777
/Library/Ruby/Gems/2.0.0/gems/cocoapods-core-0.37.2/lib/cocoapods-core/standard_error.rb:88:in `message': incompatible character encodings: ASCII-8BIT and UTF-8 (Encoding::CompatibilityError)
    from /Library/Ruby/Gems/2.0.0/gems/claide-0.8.1/lib/claide/command.rb:367:in `handle_exception'
    from /Library/Ruby/Gems/2.0.0/gems/claide-0.8.1/lib/claide/command.rb:315:in `rescue in run'
    from /Library/Ruby/Gems/2.0.0/gems/claide-0.8.1/lib/claide/command.rb:303:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.37.2/lib/cocoapods/command.rb:46:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.37.2/bin/pod:44:in `<top (required)>'
    from /usr/bin/pod:23:in `load'
    from /usr/bin/pod:23:in `<main>'

3 个答案:

答案 0 :(得分:5)

替换此字符&#34; '&#34;用这个&#34; &#39; &#34;在你的podfile中尝试再次安装。

当我从其他地方复制pod行(比如Evernote)时,它发生在我身上,一些文本编辑器会自动更改这个角色。通常它是这样的:

pod 'AFNetworking', '~> 2.0'

但是当我从其他编辑处拿走时,它可能是这样的:

pod ‘AFNetworking‘, ‘~> 2.0‘

答案 1 :(得分:2)

请按照以下步骤操作:

1.open terminal。

2.pod setup //下载podfiles需要一些时间

3.pod list //(可选)查看pod列表

4.cd桌面//(您的项目路径)

5.cd CoacPods(您的项目名称)

6.vim podfile

7.pod install

答案 2 :(得分:1)

在shell提示符下检查 chmod go -w / opt / local / bin (取决于您可能需要sudo执行此操作的权限)。