无法安装cocoapods,报告pod设置

时间:2014-10-09 08:08:44

标签: ios terminal cocoapods osx-mavericks

我正在按照本教程http://www.raywenderlich.com/64546/introduction-to-cocoapods-2在我的MacBook上安装cocoapods(Mavericks 10.9.5)。

我已成功使用此命令

sudo gem update --system
sudo gem install cocoapods

但是每当我使用pod setup时,我都会得到这个日志

/Users/tommy/.rvm/gems/ruby-2.1.1@msf/gems/xcodeproj-0.19.3/lib/xcodeproj/plist_helper.rb:140:in `<module:CoreFoundation>': uninitialized constant Fiddle::NULL (NameError)
    from /Users/tommy/.rvm/gems/ruby-2.1.1@msf/gems/xcodeproj-0.19.3/lib/xcodeproj/plist_helper.rb:70:in `<top (required)>'
    from /usr/local/Cellar/ruby193/1.9.3-p545/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:69:in `require'
    from /usr/local/Cellar/ruby193/1.9.3-p545/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:69:in `require'
    from /Users/tommy/.rvm/gems/ruby-2.1.1@msf/gems/xcodeproj-0.19.3/lib/xcodeproj/ext.rb:2:in `<top (required)>'
    from /usr/local/Cellar/ruby193/1.9.3-p545/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:69:in `require'
    from /usr/local/Cellar/ruby193/1.9.3-p545/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:69:in `require'
    from /Users/tommy/.rvm/gems/ruby-2.1.1@msf/gems/xcodeproj-0.19.3/lib/xcodeproj.rb:25:in `<top (required)>'
    from /usr/local/Cellar/ruby193/1.9.3-p545/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:69:in `require'
    from /usr/local/Cellar/ruby193/1.9.3-p545/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:69:in `require'
    from /Users/tommy/.rvm/gems/ruby-2.1.1@msf/gems/cocoapods-0.34.2/lib/cocoapods.rb:2:in `<top (required)>'
    from /usr/local/Cellar/ruby193/1.9.3-p545/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:69:in `require'
    from /usr/local/Cellar/ruby193/1.9.3-p545/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:69:in `require'
    from /Users/tommy/.rvm/gems/ruby-2.1.1@msf/gems/cocoapods-0.34.2/bin/pod:32:in `<top (required)>'
    from /Users/tommy/.rvm/gems/ruby-2.1.1@msf/bin/pod:23:in `load'
    from /Users/tommy/.rvm/gems/ruby-2.1.1@msf/bin/pod:23:in `<main>'

如果我输入pod install,也会显示。

我该怎么办?提前致谢

1 个答案:

答案 0 :(得分:19)

最新版本的cocoapods gem(v0.34.2)需要xcodeproj gem版本&gt; = 0.19.2。但最新版本的xcodeproj gem(0.19.3)导致了这个问题。

通过将xcodeproj版本修复为0.19.2来管理解决此问题。

gem uninstall xcodeproj
gem install xcodeproj -v 0.19.2

或在gemfile中指定gem 'xcodeproj', '0.19.2',然后运行bundle。