测试较旧的Rails app:循环参数引用警告,无法加载test / unit / assertions

时间:2015-02-27 16:35:31

标签: ruby-on-rails ruby-on-rails-4

的CentOS-6.6 ruby 2.2.0p0(2014-12-25修订版49005)[x86_64-linux-gnu] Bundler版本1.7.11

我正在尝试修补去年升级到4.0.1的旧版RoR应用程序。当我在进行任何更改之前运行bundle exec cucumber时,我现在遇到这种错误:

bundle exec cucumber

/home/byrnejb/Projects/Software/theHeart/code/hll_th_forex_rss/libexec/bundler/lib/ruby/2.2.0/gems/activesupport-4.0.1/lib/active_support/values/time_zone.rb:282: warning: circular argument reference - now

cannot load such file -- test/unit/assertions (LoadError)

/home/byrnejb/Projects/Software/theHeart/code/hll_th_forex_rss/libexec/bundler/lib/ruby/2.2.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `require'

/home/byrnejb/Projects/Software/theHeart/code/hll_th_forex_rss/libexec/bundler/lib/ruby/2.2.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `block in require'

/home/byrnejb/Projects/Software/theHeart/code/hll_th_forex_rss/libexec/bundler/lib/ruby/2.2.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:214:in `load_dependency'

/home/byrnejb/Projects/Software/theHeart/code/hll_th_forex_rss/libexec/bundler/lib/ruby/2.2.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `require'

/home/byrnejb/Projects/Software/theHeart/code/hll_th_forex_rss/features/support/local_env.rb:5:in `<top (required)>'
/home/byrnejb/Projects/Software/theHeart/code/hll_th_forex_rss/libexec/bundler/lib/ruby/2.2.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:223:in `load'

/home/byrnejb/Projects/Software/theHeart/code/hll_th_forex_rss/libexec/bundler/lib/ruby/2.2.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:223:in `block in load'

/home/byrnejb/Projects/Software/theHeart/code/hll_th_forex_rss/libexec/bundler/lib/ruby/2.2.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:214:in `load_dependency'

/home/byrnejb/Projects/Software/theHeart/code/hll_th_forex_rss/libexec/bundler/lib/ruby/2.2.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:223:in `load'

/home/byrnejb/Projects/Software/theHeart/code/hll_th_forex_rss/libexec/bundler/lib/ruby/2.2.0/gems/cucumber-1.3.19/lib/cucumber/rb_support/rb_language.rb:95:in `load_code_file'

/home/byrnejb/Projects/Software/theHeart/code/hll_th_forex_rss/libexec/bundler/lib/ruby/2.2.0/gems/cucumber-1.3.19/lib/cucumber/runtime/support_code.rb:180:in `load_file'

/home/byrnejb/Projects/Software/theHeart/code/hll_th_forex_rss/libexec/bundler/lib/ruby/2.2.0/gems/cucumber-1.3.19/lib/cucumber/runtime/support_code.rb:83:in `block in load_files!'

/home/byrnejb/Projects/Software/theHeart/code/hll_th_forex_rss/libexec/bundler/lib/ruby/2.2.0/gems/cucumber-1.3.19/lib/cucumber/runtime/support_code.rb:82:in `each'

/home/byrnejb/Projects/Software/theHeart/code/hll_th_forex_rss/libexec/bundler/lib/ruby/2.2.0/gems/cucumber-1.3.19/lib/cucumber/runtime/support_code.rb:82:in `load_files!'

/home/byrnejb/Projects/Software/theHeart/code/hll_th_forex_rss/libexec/bundler/lib/ruby/2.2.0/gems/cucumber-1.3.19/lib/cucumber/runtime.rb:184:in `load_step_definitions'

/home/byrnejb/Projects/Software/theHeart/code/hll_th_forex_rss/libexec/bundler/lib/ruby/2.2.0/gems/cucumber-1.3.19/lib/cucumber/runtime.rb:42:in `run!'

/home/byrnejb/Projects/Software/theHeart/code/hll_th_forex_rss/libexec/bundler/lib/ruby/2.2.0/gems/cucumber-1.3.19/lib/cucumber/cli/main.rb:47:in `execute!'

/home/byrnejb/Projects/Software/theHeart/code/hll_th_forex_rss/libexec/bundler/lib/ruby/2.2.0/gems/cucumber-1.3.19/bin/cucumber:13:in `<top (required)>'

/home/byrnejb/Projects/Software/theHeart/code/hll_th_forex_rss/libexec/bundler/lib/ruby/2.2.0/bin/cucumber:23:in `load'

/home/byrnejb/Projects/Software/theHeart/code/hll_th_forex_rss/libexec/bundler/lib/ruby/2.2.0/bin/cucumber:23:in `<main>'

warning: circular argument reference - xxxx仅限于Cucumber,之前为1.3.10。所以我将黄瓜更新到1.3.19。现在我得到了积极支持的错误。有没有人见过这个。

我遇到了Minitest的问题,导致该项目无法在去年春天推进到RoR-4.1。我不知道这是否相关,但我将其包括在内是为了完整性。

在任何情况下,谁将测试依赖项放入分布式运行时代码中?为什么activesupport会抱怨&#39; test / unit / assertions&#39;?

2 个答案:

答案 0 :(得分:1)

尝试从Rails 4.0.1升级到4.0.13

如果这不起作用,请尝试使用Ruby 2.1.5查看是否收到相同的错误消息。我打赌你正在使用的一些宝石遇到this issue with Ruby 2.2Example 1Example 2Example 3 from Rails

长期解决方案是使用Ruby 2.2兼容的gems,但是暂时切换到2.1.5,您可以在短期内解决问题并缩小导致错误的特定gem版本。< / p>

答案 1 :(得分:0)

我只是在Gemfile中添加gem'test-unit'并再次运行'bundle install'。它解决了我。