当我在 Rails 中运行测试时出现此错误该怎么办?
使用 ruby1.9.2 Rails3.1.0
我正在我的上网本上工作,所以这不是我通常的开发环境。本周早些时候,我在桌面上克隆了一个正在使用的存储库。现在,当我运行 rake test 时,我在终端中收到此错误。
^[[1;5C/home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/rack-1.3.4/lib/rack/backports/uri/common_192.rb:53: warning: already initialized constant WFKV_
/home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/turn-0.8.3/lib/turn/autorun/minitest.rb:14:in `<top (required)>': MiniTest v1.6.0 is out of date. (RuntimeError)
`gem install minitest` and add `gem 'minitest' to you test helper.
from /home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
from /home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `block in require'
from /home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:225:in `load_dependency'
from /home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
from /home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/turn-0.8.3/lib/turn.rb:13:in `<top (required)>'
from /home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
from /home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `block in require'
from /home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:225:in `load_dependency'
from /home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
from /home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/railties-3.1.0/lib/rails/test_help.rb:19:in `<top (required)>'
from /home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
from /home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `block in require'
from /home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:225:in `load_dependency'
from /home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
from /home/work/Desktop/sa_clubbing/test/test_helper.rb:3:in `<top (required)>'
from /home/work/Desktop/sa_clubbing/test/unit/blog_post_test.rb:1:in `require'
from /home/work/Desktop/sa_clubbing/test/unit/blog_post_test.rb:1:in `<top (required)>'
from /home/work/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/rake_test_loader.rb:9:in `require'
from /home/work/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/rake_test_loader.rb:9:in `block (2 levels) in <main>'
from /home/work/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/rake_test_loader.rb:9:in `each'
from /home/work/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/rake_test_loader.rb:9:in `block in <main>'
from /home/work/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/rake_test_loader.rb:5:in `each'
from /home/work/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/rake_test_loader.rb:5:in `<main>'
/home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/rack-1.3.4/lib/rack/backports/uri/common_192.rb:53: warning: already initialized constant WFKV_
/home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/turn-0.8.3/lib/turn/autorun/minitest.rb:14:in `<top (required)>': MiniTest v1.6.0 is out of date. (RuntimeError)
`gem install minitest` and add `gem 'minitest' to you test helper.
from /home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
from /home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `block in require'
from /home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:225:in `load_dependency'
from /home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
from /home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/turn-0.8.3/lib/turn.rb:13:in `<top (required)>'
from /home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
from /home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `block in require'
from /home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:225:in `load_dependency'
from /home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
from /home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/railties-3.1.0/lib/rails/test_help.rb:19:in `<top (required)>'
from /home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
from /home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `block in require'
from /home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:225:in `load_dependency'
from /home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
from /home/work/Desktop/sa_clubbing/test/test_helper.rb:3:in `<top (required)>'
from /home/work/Desktop/sa_clubbing/test/functional/landing_page_controller_test.rb:1:in `require'
from /home/work/Desktop/sa_clubbing/test/functional/landing_page_controller_test.rb:1:in `<top (required)>'
from /home/work/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/rake_test_loader.rb:9:in `require'
from /home/work/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/rake_test_loader.rb:9:in `block (2 levels) in <main>'
from /home/work/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/rake_test_loader.rb:9:in `each'
from /home/work/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/rake_test_loader.rb:9:in `block in <main>'
from /home/work/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/rake_test_loader.rb:5:in `each'
from /home/work/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/rake_test_loader.rb:5:in `<main>'
Errors running test:units, test:functionals!
我按照说明进行了 gem install minitest
,但仍然得到相同的结果。有人知道在这里可以做什么吗?
我刚刚检查了我的 gem 列表,它说 minitest 版本 2.6.2 已安装。我不知道为什么错误显示 MiniTest v1.6.0 is out of date
我没有使用该版本
using ruby1.9.2 rails3.1.0
I am working from my netbook, so it is not my usual dev environment. I cloned a repo that I was working with on my desktop early this week. Now when I run rake test
I get this error in the terminal.
^[[1;5C/home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/rack-1.3.4/lib/rack/backports/uri/common_192.rb:53: warning: already initialized constant WFKV_
/home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/turn-0.8.3/lib/turn/autorun/minitest.rb:14:in `<top (required)>': MiniTest v1.6.0 is out of date. (RuntimeError)
`gem install minitest` and add `gem 'minitest' to you test helper.
from /home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
from /home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `block in require'
from /home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:225:in `load_dependency'
from /home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
from /home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/turn-0.8.3/lib/turn.rb:13:in `<top (required)>'
from /home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
from /home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `block in require'
from /home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:225:in `load_dependency'
from /home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
from /home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/railties-3.1.0/lib/rails/test_help.rb:19:in `<top (required)>'
from /home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
from /home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `block in require'
from /home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:225:in `load_dependency'
from /home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
from /home/work/Desktop/sa_clubbing/test/test_helper.rb:3:in `<top (required)>'
from /home/work/Desktop/sa_clubbing/test/unit/blog_post_test.rb:1:in `require'
from /home/work/Desktop/sa_clubbing/test/unit/blog_post_test.rb:1:in `<top (required)>'
from /home/work/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/rake_test_loader.rb:9:in `require'
from /home/work/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/rake_test_loader.rb:9:in `block (2 levels) in <main>'
from /home/work/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/rake_test_loader.rb:9:in `each'
from /home/work/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/rake_test_loader.rb:9:in `block in <main>'
from /home/work/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/rake_test_loader.rb:5:in `each'
from /home/work/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/rake_test_loader.rb:5:in `<main>'
/home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/rack-1.3.4/lib/rack/backports/uri/common_192.rb:53: warning: already initialized constant WFKV_
/home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/turn-0.8.3/lib/turn/autorun/minitest.rb:14:in `<top (required)>': MiniTest v1.6.0 is out of date. (RuntimeError)
`gem install minitest` and add `gem 'minitest' to you test helper.
from /home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
from /home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `block in require'
from /home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:225:in `load_dependency'
from /home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
from /home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/turn-0.8.3/lib/turn.rb:13:in `<top (required)>'
from /home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
from /home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `block in require'
from /home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:225:in `load_dependency'
from /home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
from /home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/railties-3.1.0/lib/rails/test_help.rb:19:in `<top (required)>'
from /home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
from /home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `block in require'
from /home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:225:in `load_dependency'
from /home/work/.rvm/gems/ruby-1.9.2-p290@rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
from /home/work/Desktop/sa_clubbing/test/test_helper.rb:3:in `<top (required)>'
from /home/work/Desktop/sa_clubbing/test/functional/landing_page_controller_test.rb:1:in `require'
from /home/work/Desktop/sa_clubbing/test/functional/landing_page_controller_test.rb:1:in `<top (required)>'
from /home/work/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/rake_test_loader.rb:9:in `require'
from /home/work/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/rake_test_loader.rb:9:in `block (2 levels) in <main>'
from /home/work/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/rake_test_loader.rb:9:in `each'
from /home/work/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/rake_test_loader.rb:9:in `block in <main>'
from /home/work/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/rake_test_loader.rb:5:in `each'
from /home/work/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/rake_test_loader.rb:5:in `<main>'
Errors running test:units, test:functionals!
I followed the instruction and did gem install minitest
, but still get the same result. Anyone know what to do here?
I just checked my gem list and it says minitest version 2.6.2 is installed. I don't know why the error is saying MiniTest v1.6.0 is out of date
I am not using that version
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我通过以下方式修复了它:
在 Gemfile 中添加以下 gem,然后运行捆绑安装
I fixed it in the following way:
add in your Gemfile following gem, Then run bundle install
在项目根目录中有一个
.rvmrc
文件可以方便地自动设置正确的 ruby/gemset。还要确保您的 Gemfile/Gemfile.lock 使用正确的版本。Having a
.rvmrc
file in the project's root directory is handy for automatically setting the correct ruby/gemset. Also make sure your Gemfile/Gemfile.lock are using the correct version.以下是修复方法...
转到应用程序的根目录并输入:
gem 安装 minitest
然后转到位于应用程序根目录中的 gemfile 并添加
gem 'minitest' 位于文件底部。
Here is how to fix it...
go to the root of your aplication and type:
gem install minitest
Then go to your gemfile located in the root of your app and add
gem 'minitest' at the bottom of the file.