Rspec错误:无效选项

编程入门 行业动态 更新时间:2024-10-23 20:15:54
Rspec错误:无效选项--warnings(Rspec error: invalid option --warnings)

我正在研究Michael Hartl的Ruby on Rails教程,并参考了3.2.1节 ,他首先介绍了测试驱动开发和Rspec的使用。 我相信我忠实地遵循教程(包括按照指示编辑spec_helper.rb和static_pages_spec.rb文件)。 我到了指示我跑的地步:

$ bundle exec spec spec/requests/static_pages_spec.rb

我得到以下消息作为回应:

无效选项 - 警告

请使用--help获取有效选项列表

不可否认,我对所有这一切都很陌生,但我无法找到这个特定错误信息的含义(以及我应该做的)的答案。

我的Gemfile:

ruby '2.0.0' #ruby-gemset=railstutorial_rails_4_0 gem 'rails', '4.0.5' group :development, :test do gem 'sqlite3', '1.3.8' gem 'rspec-rails', '2.13.1' end group :test do gem 'selenium-webdriver', '2.35.1' gem 'capybara', '2.1.0' end gem 'sass-rails', '4.0.1' gem 'uglifier', '2.1.1' gem 'coffee-rails', '4.0.1' gem 'jquery-rails', '3.0.4' gem 'turbolinks', '1.1.1' gem 'jbuilder', '1.0.2' group :doc do gem 'sdoc', '~> 0.4.0', require: false end group :production do gem 'pg', '0.15.1' gem 'rails_12factor', '0.0.2' end

I am working my way through Michael Hartl's Ruby on Rails Tutorial, and have come to section 3.2.1, where he first introduces test driven development and the use of Rspec. I believe I am faithfully following the tutorial (including editing the spec_helper.rb and static_pages_spec.rb files as directed). I get to the point where I am directed to run:

$ bundle exec spec spec/requests/static_pages_spec.rb

And I get the following message in response:

invalid option --warnings

please use --help for a listing of valid options

Admittedly, I am pretty new to all of this, but I have not been able to find an answer as to what this particular error message means (and what I am supposed to do).

My Gemfile:

ruby '2.0.0' #ruby-gemset=railstutorial_rails_4_0 gem 'rails', '4.0.5' group :development, :test do gem 'sqlite3', '1.3.8' gem 'rspec-rails', '2.13.1' end group :test do gem 'selenium-webdriver', '2.35.1' gem 'capybara', '2.1.0' end gem 'sass-rails', '4.0.1' gem 'uglifier', '2.1.1' gem 'coffee-rails', '4.0.1' gem 'jquery-rails', '3.0.4' gem 'turbolinks', '1.1.1' gem 'jbuilder', '1.0.2' group :doc do gem 'sdoc', '~> 0.4.0', require: false end group :production do gem 'pg', '0.15.1' gem 'rails_12factor', '0.0.2' end

最满意答案

那是一个非常古老的rspec版本。 我建议更新一些(或者你可以编辑你的.rspec文件来删除--warnings)。

That's a pretty old version of rspec. I'd suggest getting something newer (or you could edit your .rspec file to remove --warnings).

更多推荐

本文发布于:2023-08-06 19:45:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1455694.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:选项   错误   Rspec

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!