Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit tests fail in Ruby 2.7.0 and 2.7.1 #69

Closed
mdorf opened this issue Jun 3, 2020 · 4 comments
Closed

Unit tests fail in Ruby 2.7.0 and 2.7.1 #69

mdorf opened this issue Jun 3, 2020 · 4 comments
Assignees
Labels

Comments

@mdorf
Copy link
Member

mdorf commented Jun 3, 2020

The exception:

/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activesupport-3.2.22.5/lib/active_support/core_ext/object/duplicable.rb:111:
in `<class:BigDecimal>': undefined method `new' for BigDecimal:Class (NoMethodError)

Full Stack Trace:

Traceback (most recent call last):
	30: from /Users/mdorf/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rake-10.5.0/lib/rake/rake_test_loader.rb:4:in `<main>'
	29: from /Users/mdorf/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rake-10.5.0/lib/rake/rake_test_loader.rb:4:in `select'
	28: from /Users/mdorf/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rake-10.5.0/lib/rake/rake_test_loader.rb:15:in `block in <main>'
	27: from /Users/mdorf/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rake-10.5.0/lib/rake/rake_test_loader.rb:15:in `require'
	26: from /Users/mdorf/dev/ncbo/ontologies_api/test/controllers/test_search_controller.rb:1:in `<top (required)>'
	25: from /Users/mdorf/dev/ncbo/ontologies_api/test/controllers/test_search_controller.rb:1:in `require_relative'
	24: from /Users/mdorf/dev/ncbo/ontologies_api/test/test_case.rb:15:in `<top (required)>'
	23: from /Users/mdorf/dev/ncbo/ontologies_api/test/test_case.rb:15:in `require_relative'
	22: from /Users/mdorf/dev/ncbo/ontologies_api/app.rb:165:in `<top (required)>'
	21: from /Users/mdorf/dev/ncbo/ontologies_api/app.rb:165:in `require_relative'
	20: from /Users/mdorf/dev/ncbo/ontologies_api/init.rb:14:in `<top (required)>'
	19: from /Users/mdorf/dev/ncbo/ontologies_api/init.rb:3:in `require_dir'
	18: from /Users/mdorf/dev/ncbo/ontologies_api/init.rb:3:in `each'
	17: from /Users/mdorf/dev/ncbo/ontologies_api/init.rb:3:in `block in require_dir'
	16: from /Users/mdorf/dev/ncbo/ontologies_api/init.rb:3:in `require_relative'
	15: from /Users/mdorf/dev/ncbo/ontologies_api/controllers/recommender_controller.rb:1:in `<top (required)>'
	14: from /Users/mdorf/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/backports-3.17.2/lib/backports/std_lib.rb:12:in `require_with_backports'
	13: from /Users/mdorf/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/backports-3.17.2/lib/backports/std_lib.rb:12:in `require'
	12: from /Users/mdorf/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activesupport-3.2.22.5/lib/active_support/all.rb:3:in `<top (required)>'
	11: from /Users/mdorf/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/backports-3.17.2/lib/backports/std_lib.rb:12:in `require_with_backports'
	10: from /Users/mdorf/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/backports-3.17.2/lib/backports/std_lib.rb:12:in `require'
	 9: from /Users/mdorf/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activesupport-3.2.22.5/lib/active_support/core_ext.rb:1:in `<top (required)>'
	 8: from /Users/mdorf/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activesupport-3.2.22.5/lib/active_support/core_ext.rb:1:in `each'
	 7: from /Users/mdorf/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activesupport-3.2.22.5/lib/active_support/core_ext.rb:2:in `block in <top (required)>'
	 6: from /Users/mdorf/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/backports-3.17.2/lib/backports/std_lib.rb:12:in `require_with_backports'
	 5: from /Users/mdorf/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/backports-3.17.2/lib/backports/std_lib.rb:12:in `require'
	 4: from /Users/mdorf/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activesupport-3.2.22.5/lib/active_support/core_ext/object.rb:3:in `<top (required)>'
	 3: from /Users/mdorf/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/backports-3.17.2/lib/backports/std_lib.rb:12:in `require_with_backports'
	 2: from /Users/mdorf/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/backports-3.17.2/lib/backports/std_lib.rb:12:in `require'
	 1: from /Users/mdorf/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activesupport-3.2.22.5/lib/active_support/core_ext/object/duplicable.rb:109:in `<top (required)>'
/Users/mdorf/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activesupport-3.2.22.5/lib/active_support/core_ext/object/duplicable.rb:111:in `<class:BigDecimal>': undefined method `new' for BigDecimal:Class (NoMethodError)
@mdorf mdorf added the bug label Jun 3, 2020
@mdorf mdorf self-assigned this Jun 3, 2020
@mdorf
Copy link
Member Author

mdorf commented Jun 3, 2020

This appears to be due to this include in the controllers/recommender_controller.rb:
require 'active_support/all'

Our Gem for Active Support specifies:

gem 'activesupport', '~> 3.0'

I've tried removing the 3.0 limit and updating Active Support to the latest version with no success.

@mdorf
Copy link
Member Author

mdorf commented Jun 5, 2020

I've confirmed that this problem is NOT manifested in Ruby v2.5.8.

I've confirmed that this problem affects Ruby v2.7.0 and v2.7.1.

@mdorf
Copy link
Member Author

mdorf commented Jun 5, 2020

Commenting out the include require 'active_support/all' results in a bad output from the Recommender:

With the include in place:
Screen Shot 2020-06-04 at 5 05 38 PM

With the include commented out:
Screen Shot 2020-06-04 at 5 05 52 PM

@mdorf mdorf changed the title Unit tests fail in Ruby 2.7.0 Unit tests fail in Ruby 2.7.0 and 2.7.1 Jun 5, 2020
@mdorf
Copy link
Member Author

mdorf commented Jun 5, 2020

Based on a proposed solution in this thread: ruby/bigdecimal#127 (comment), adding

gem 'bigdecimal', '1.4.2'

appears to solve the issue.

@mdorf mdorf closed this as completed in fe7009c Jun 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant