运行ghunit install -n ProjectName
时,我得到以下错误。
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- xcodeproj/ext (LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Library/Ruby/Gems/2.0.0/gems/ghunit-1.0.3/lib/ghunit/project.rb:2:in `<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Library/Ruby/Gems/2.0.0/gems/ghunit-1.0.3/lib/ghunit.rb:4:in `<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Library/Ruby/Gems/2.0.0/gems/ghunit-1.0.3/bin/ghunit:4:in `<top (required)>'
from /usr/bin/ghunit:23:in `load'
from /usr/bin/ghunit:23:in `<main>'
我还尝试手动添加目标,添加GHUnit.framework并运行。在我需要测试我的类之前,它在一个简单的单元测试样本中运行得很好。所以我添加了标题,写了一些代码,然后它给了我未定义的符号。尝试添加cocoapod-lib,苹果的附加框架,几乎是我在主要项目应用程序目标中使用的,没有什么能解决这个问题。
我在Github上报告了这个错误后,一个合作者已经在master中修复了这个错误。