当前位置:  开发笔记 > 后端 > 正文

Ruby on Rails.捆绑.黄瓜.耙子流产了!命令失败,状态为(1)

如何解决《RubyonRails.捆绑.黄瓜.耙子流产了!命令失败,状态为(1)》经验,为你挑选了1个好方法。

使用Bundler和Cucumber与Rails 3时遇到问题.

当我运行时,$ rake cucumber我得到以下输出:

bundle exec /usr/local/bin/ruby -I "/usr/local/lib/ruby/gems/1.9.1/gems/cucumber-
0.8.5/lib:lib" "/usr/local/lib/ruby/gems/1.9.1/gems/cucumber-0.8.5/bin/cucumber"  --profile default
(in /home//practice/rails/blog)
Using the default profile...
UUUU

1 scenario (1 undefined)
4 steps (4 undefined)
0m1.552s

You can implement step definitions for undefined steps with these snippets:

Given /^a post$/ do
  pending # express the regexp above with the code you wish you had
end

Given /^a name was specified$/ do
  pending # express the regexp above with the code you wish you had
end

When /^I save the post$/ do
  pending # express the regexp above with the code you wish you had
end

Then /^the post should be saving$/ do
  pending # express the regexp above with the code you wish you had
end

rake aborted!
Command failed with status (1): [bundle exec /usr/local/bin/ruby -I "/usr/l...]
/usr/local/lib/ruby/1.9.1/rake.rb:993:in `block in sh'
/usr/local/lib/ruby/1.9.1/rake.rb:1008:in `call'
/usr/local/lib/ruby/1.9.1/rake.rb:1008:in `sh'
/usr/local/lib/ruby/1.9.1/rake.rb:1092:in `sh'
/usr/local/lib/ruby/gems/1.9.1/gems/cucumber-0.8.5/lib/cucumber/rake/task.rb:72:in `run'
/usr/local/lib/ruby/gems/1.9.1/gems/cucumber-0.8.5/lib/cucumber/rake/task.rb:142:in `block in define_task'
/usr/local/lib/ruby/1.9.1/rake.rb:634:in `call'
/usr/local/lib/ruby/1.9.1/rake.rb:634:in `block in execute'
/usr/local/lib/ruby/1.9.1/rake.rb:629:in `each'
/usr/local/lib/ruby/1.9.1/rake.rb:629:in `execute'
/usr/local/lib/ruby/1.9.1/rake.rb:595:in `block in invoke_with_call_chain'
/usr/local/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/usr/local/lib/ruby/1.9.1/rake.rb:588:in `invoke_with_call_chain'
/usr/local/lib/ruby/1.9.1/rake.rb:605:in `block in invoke_prerequisites'
/usr/local/lib/ruby/1.9.1/rake.rb:602:in `each'
/usr/local/lib/ruby/1.9.1/rake.rb:602:in `invoke_prerequisites'
/usr/local/lib/ruby/1.9.1/rake.rb:594:in `block in invoke_with_call_chain'
/usr/local/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/usr/local/lib/ruby/1.9.1/rake.rb:588:in `invoke_with_call_chain'
/usr/local/lib/ruby/1.9.1/rake.rb:581:in `invoke'
/usr/local/lib/ruby/1.9.1/rake.rb:2041:in `invoke_task'
/usr/local/lib/ruby/1.9.1/rake.rb:2019:in `block (2 levels) in top_level'
/usr/local/lib/ruby/1.9.1/rake.rb:2019:in `each'
/usr/local/lib/ruby/1.9.1/rake.rb:2019:in `block in top_level'
/usr/local/lib/ruby/1.9.1/rake.rb:2058:in `standard_exception_handling'
/usr/local/lib/ruby/1.9.1/rake.rb:2013:in `top_level'
/usr/local/lib/ruby/1.9.1/rake.rb:1992:in `run'
/usr/local/bin/rake:31:in `'

尽管有这个输出我的功能很好,当我添加步骤定义并传递它们时,所有更改都正确显示在控制台中.

这是我的Gemfile:

group :development, :test do
  gem 'cucumber-rails'
  gem 'rspec-rails', '>= 2.0.0.beta.22'
  gem 'Selenium'
  gem 'thin'
  gem 'webrat'
end

我想注意,如果我使用bundle exec cucumbercucumber features/命令我没有收到任何错误消息.

这个问题的原因是什么?我该如何解决?

谢谢.

Debian GNU/Linux 5.0.6;

Ruby 1.9.2;

Ruby on Rails 3.0.0;

Bundler 1.0.0;

黄瓜0.8.5;

黄瓜 - 路轨0.3.2.



1> 小智..:

我也看到了同样的问题.通过一点点狩猎,我可以想出这个错误即将到来,但仍然不知道如何解决它.

问题是"bundle exec ..."shell调用正在退出,状态代码为"1".这是rake.rb脚本的错误,因此抛出这些行.看起来它只是某种误报.

此外,仅在所有方案都通过时才会发生这种情况.如果甚至出现单个故障,您将看不到此错误.


原来它是在cucumber.yml和undefined任务中的--strict指定.查看此处打开的错误:https://rspec.lighthouseapp.com/projects/16211/tickets/680-rake-cucumber-throws-an-error-after-running-all-the-scenarios#ticket-680- 1
推荐阅读
云聪京初瑞子_617
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有