我们最近在另一台机器上安装了我们框架的副本,由于某种原因,我们在使用'puts'而不是'Kernel.puts'时遇到错误(我们使用Ruby)
这不是一个大问题,但我们偶尔会使用'puts'来写入黄瓜结果文件。
这只能在1台机器上运行,而不是在另一台机器上运行。两者都是mac minis,规格相同。
两台机器都有相同的gemlist,相同版本的Ruby等(它们几乎同时安装)。
其他人见过这个吗?
日志:
2015-06-30 14:44:59 +0100 OUT: Error: undefined method <<' for nil:NilClass 2015-06-30 14:44:59 +0100 OUT: /Library/Ruby/Gems/2.0.0/gems/gherkin-2.12.2/lib/gherkin/formatter/json_formatter.rb:89:inwrite'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/formatter/gherkin_formatter_adapter.rb:166:in puts' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/ast/tree_walker.rb:181:inblock in send_to_all'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/ast/tree_walker.rb:179:in each' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/ast/tree_walker.rb:179:insend_to_all'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/ast/tree_walker.rb:173:in broadcast' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/ast/tree_walker.rb:154:inputs'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/runtime/user_interface.rb:14:in puts' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/rb_support/rb_world.rb:107:inputs'
/Users/jenkins/workspace/TEST-regression-test_trial_mini/automation/ios/features/support/hooks.rb:104:in block in <top (required)>' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/core_ext/instance_exec.rb:48:ininstance_exec'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/core_ext/instance_exec.rb:48:in block in cucumber_instance_exec' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/core_ext/instance_exec.rb:69:incucumber_run_with_backtrace_filtering'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/core_ext/instance_exec.rb:36:in cucumber_instance_exec' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/rb_support/rb_hook.rb:14:ininvoke'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/language_support/language_methods.rb:114:in invoke' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/language_support/language_methods.rb:102:inblock in execute_before'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/language_support/language_methods.rb:101:in each' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/language_support/language_methods.rb:101:inexecute_before'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/language_support/language_methods.rb:15:in before' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/runtime/support_code.rb:112:inblock in fire_hook'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/runtime/support_code.rb:111:in each' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/runtime/support_code.rb:111:infire_hook'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/runtime.rb:107:in before' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/runtime.rb:98:inbefore_and_after'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/runtime.rb:82:in block in with_hooks' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/runtime/support_code.rb:120:incall'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/runtime/support_code.rb:120:in block (3 levels) in around' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/language_support/language_methods.rb:9:inblock in around'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/language_support/language_methods.rb:97:in call' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/language_support/language_methods.rb:97:inexecute_around'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/language_support/language_methods.rb:8:in around' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/runtime/support_code.rb:119:inblock (2 levels) in around'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/runtime/support_code.rb:123:in call' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/runtime/support_code.rb:123:inaround'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/runtime.rb:94:in around' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/runtime.rb:81:inwith_hooks'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/ast/tree_walker.rb:13:in execute' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/ast/scenario.rb:32:inblock in accept'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/ast/scenario.rb:79:in with_visitor' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/ast/scenario.rb:31:inaccept'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/ast/tree_walker.rb:58:in block in visit_feature_element' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/ast/tree_walker.rb:170:inbroadcast'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/ast/tree_walker.rb:57:in visit_feature_element' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/ast/feature.rb:38:inblock in accept'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/ast/feature.rb:37:in each' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/ast/feature.rb:37:inaccept'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/ast/tree_walker.rb:27:in block in visit_feature' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/ast/tree_walker.rb:170:inbroadcast'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/ast/tree_walker.rb:26:in visit_feature' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/ast/features.rb:28:inblock in accept'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/ast/features.rb:17:in each' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/ast/features.rb:17:ineach'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/ast/features.rb:27:in accept' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/ast/tree_walker.rb:21:inblock in visit_features'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/ast/tree_walker.rb:170:in broadcast' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/ast/tree_walker.rb:20:invisit_features'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/runtime.rb:49:in run!' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/cli/main.rb:47:inexecute!'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/bin/cucumber:13:in <top (required)>' /usr/bin/cucumber:23:inload'
/usr/bin/cucumber:23:in
答案 0 :(得分:0)
某处某处覆盖了puts
。你只需要找到它。作为替代方案,请使用warn
。来自Avdi Grimm的 Exceptional Ruby :
然而,提出了一些需要作为失败报告方法的东西。因为它的输出转到$ stdout,默认情况下是缓冲的,输出可能不会立即打印,或者它可能以令人惊讶的顺序出现
warn更简洁,同时仍然使用$ stderr作为其输出流。另请注意,通过将-W0标志传递给Ruby,可以暂时禁止warn的输出。