gpt4 book ai didi

ruby-on-rails - 类 `_run_suites' 的未定义方法 `Minitest::Unit' (NameError)

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:30:56 25 4
gpt4 key购买 nike

我一直在尝试在我的 ROR 网络应用程序中使用 Rspec,但我无法仅在 nitrous.io 上本地运行测试

登录我的电脑:

/usr/lib/ruby/2.1.0/minitest/parallel_each.rb:67:in `<class:Unit>': undefined method `_run_suites' for class `Minitest::Unit' (NameError)
from /usr/lib/ruby/2.1.0/minitest/parallel_each.rb:66:in `<top (required)>'
from /var/lib/gems/2.1.0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:229:in `require'
from /var/lib/gems/2.1.0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:229:in `block in require'
from /var/lib/gems/2.1.0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:214:in `load_dependency'
from /var/lib/gems/2.1.0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:229:in `require'
from /var/lib/gems/2.1.0/gems/activesupport-4.0.8/lib/active_support/testing/isolation.rb:2:in `<top (required)>'
from /var/lib/gems/2.1.0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:229:in `require'
from /var/lib/gems/2.1.0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:229:in `block in require'
from /var/lib/gems/2.1.0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:214:in `load_dependency'
from /var/lib/gems/2.1.0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:229:in `require'
from /var/lib/gems/2.1.0/gems/activesupport-4.0.8/lib/active_support/test_case.rb:9:in `<top (required)>'
from /var/lib/gems/2.1.0/gems/actionpack-4.0.8/lib/action_controller/test_case.rb:405:in `<module:ActionController>'
from /var/lib/gems/2.1.0/gems/actionpack-4.0.8/lib/action_controller/test_case.rb:6:in `<top (required)>'
from /var/lib/gems/2.1.0/gems/rspec-rails-2.13.1/lib/rspec/rails/example/controller_example_group.rb:9:in `<module:ControllerExampleGroup>'
from /var/lib/gems/2.1.0/gems/rspec-rails-2.13.1/lib/rspec/rails/example/controller_example_group.rb:6:in `<module:Rails>'
from /var/lib/gems/2.1.0/gems/rspec-rails-2.13.1/lib/rspec/rails/example/controller_example_group.rb:5:in `<top (required)>'
from /var/lib/gems/2.1.0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:229:in `require'
from /var/lib/gems/2.1.0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:229:in `block in require'
from /var/lib/gems/2.1.0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:214:in `load_dependency'
from /var/lib/gems/2.1.0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:229:in `require'
from /var/lib/gems/2.1.0/gems/rspec-rails-2.13.1/lib/rspec/rails/example.rb:2:in `<top (required)>'
from /var/lib/gems/2.1.0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:229:in `require'
from /var/lib/gems/2.1.0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:229:in `block in require'
from /var/lib/gems/2.1.0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:214:in `load_dependency'
from /var/lib/gems/2.1.0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:229:in `require'
from /var/lib/gems/2.1.0/gems/rspec-rails-2.13.1/lib/rspec/rails.rb:16:in `<top (required)>'
from /var/lib/gems/2.1.0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:229:in `require'
from /var/lib/gems/2.1.0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:229:in `block in require'
from /var/lib/gems/2.1.0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:214:in `load_dependency'
from /var/lib/gems/2.1.0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:229:in `require'
from /home/dyego/Documents/coisas/rails/workspace/podcast-central/spec/spec_helper.rb:8:in `block in <top (required)>'
from /var/lib/gems/2.1.0/gems/spork-1.0.0rc4/lib/spork.rb:24:in `prefork'
from /home/dyego/Documents/coisas/rails/workspace/podcast-central/spec/spec_helper.rb:5:in `<top (required)>'
from /var/lib/gems/2.1.0/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:460:in `require'
from /var/lib/gems/2.1.0/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:460:in `block in requires='
from /var/lib/gems/2.1.0/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:460:in `map'
from /var/lib/gems/2.1.0/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:460:in `requires='
from /var/lib/gems/2.1.0/gems/rspec-core-2.13.1/lib/rspec/core/configuration_options.rb:27:in `block in configure'
from /var/lib/gems/2.1.0/gems/rspec-core-2.13.1/lib/rspec/core/configuration_options.rb:26:in `each'
from /var/lib/gems/2.1.0/gems/rspec-core-2.13.1/lib/rspec/core/configuration_options.rb:26:in `configure'
from /var/lib/gems/2.1.0/gems/rspec-core-2.13.1/lib/rspec/core/command_line.rb:21:in `run'
from /var/lib/gems/2.1.0/gems/rspec-core-2.13.1/lib/rspec/core/runner.rb:80:in `run'
from /var/lib/gems/2.1.0/gems/rspec-core-2.13.1/lib/rspec/core/runner.rb:17:in `block in autorun'
Run options: --seed 9081

# Running:



Finished in 0.001545s, 0.0000 runs/s, 0.0000 assertions/s.

0 runs, 0 assertions, 0 failures, 0 errors, 0 skips

Nitrous.io 日志:

No examples found.                                                                                                                                                   


Finished in 0.00009 seconds
0 examples, 0 failures

Randomized with seed 46830

所以,基本上我可以在 nitrous.io 上运行测试,但不能在本地计算机上运行,​​我能找到的这两个环境之间的唯一主要区别是 ruby​​ 版本:

Nitrous.io:ruby 2.1.1p76(2014-02-24 修订版 45161)[x86_64-linux]
我的电脑:ruby 2.1.5p273(2014-11-13 修订版 48405)[x86_64-linux-gnu]

显然这个文件导致错误“/usr/lib/ruby/2.1.0/minitest/parallel_each.rb:67:in”

它在 2.10 ruby​​ 的文件夹中

在 nitrous.io 上我没有这个文件,而是有一个不同的版本“/usr/lib/ruby/1.9.1$”

有人经历过类似的事情吗?

谢谢。

编辑

我发现了一些类似的问题,但它们要么没有解决要么没有答案

示例:Rails - ruby/2.1.0/minitest/parallel_each.rb:67:in '<class:Unit>': undefined method '_run_suites' for class 'Minitest::Unit' (NameError)

Ruby On Rails - rspec fails after include gem 'minitest'

最佳答案

我正在使用 minitest,在删除它之后,我能够运行测试 ;) 。但我花了将近 3 天的时间才意识到...... – SupimpaAllTheWay

关于ruby-on-rails - 类 `_run_suites' 的未定义方法 `Minitest::Unit' (NameError),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27411030/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com