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

Fix rspec on ruby 2.7 #29

Merged
merged 3 commits into from
Feb 19, 2024
Merged

Fix rspec on ruby 2.7 #29

merged 3 commits into from
Feb 19, 2024

Conversation

hammerhead
Copy link
Member

@hammerhead hammerhead commented Feb 19, 2024

Summary of the changes / Why this is an improvement

Not much progress on upgrading itself, but at least makes the build green again. It failed before on the last ruby 2 version:

 activerecord-crate-adapter/ [main*] bundle exec rspec                      
Traceback (most recent call last):
	21: from /Users/niklasschmidtmer/.rbenv/versions/2.7.8/lib/ruby/gems/2.7.0/gems/rspec-core-2.99.2/lib/rspec/core/runner.rb:17:in `block in autorun'
	20: from /Users/niklasschmidtmer/.rbenv/versions/2.7.8/lib/ruby/gems/2.7.0/gems/rspec-core-2.99.2/lib/rspec/core/runner.rb:103:in `run'
	19: from /Users/niklasschmidtmer/.rbenv/versions/2.7.8/lib/ruby/gems/2.7.0/gems/rspec-core-2.99.2/lib/rspec/core/command_line.rb:18:in `run'
	18: from /Users/niklasschmidtmer/.rbenv/versions/2.7.8/lib/ruby/gems/2.7.0/gems/rspec-core-2.99.2/lib/rspec/core/configuration.rb:1065:in `load_spec_files'
	17: from /Users/niklasschmidtmer/.rbenv/versions/2.7.8/lib/ruby/gems/2.7.0/gems/rspec-core-2.99.2/lib/rspec/core/configuration.rb:1065:in `each'
	16: from /Users/niklasschmidtmer/.rbenv/versions/2.7.8/lib/ruby/gems/2.7.0/gems/rspec-core-2.99.2/lib/rspec/core/configuration.rb:1065:in `block in load_spec_files'
	15: from /Users/niklasschmidtmer/.rbenv/versions/2.7.8/lib/ruby/gems/2.7.0/gems/rspec-core-2.99.2/lib/rspec/core/configuration.rb:1065:in `load'
	14: from /Users/niklasschmidtmer/Documents/GitHub/activerecord-crate-adapter/spec/activerecord/connection_adapters/crate/table_definition_spec.rb:22:in `<top (required)>'
	13: from /Users/niklasschmidtmer/Documents/GitHub/activerecord-crate-adapter/spec/activerecord/connection_adapters/crate/table_definition_spec.rb:22:in `require_relative'
	12: from /Users/niklasschmidtmer/Documents/GitHub/activerecord-crate-adapter/spec/spec_helper.rb:24:in `<top (required)>'
	11: from /Users/niklasschmidtmer/Documents/GitHub/activerecord-crate-adapter/spec/spec_helper.rb:24:in `require'
	10: from /Users/niklasschmidtmer/Documents/GitHub/activerecord-crate-adapter/lib/activerecord-crate-adapter.rb:22:in `<top (required)>'
	 9: from /Users/niklasschmidtmer/Documents/GitHub/activerecord-crate-adapter/lib/activerecord-crate-adapter.rb:22:in `require'
	 8: from /Users/niklasschmidtmer/Documents/GitHub/activerecord-crate-adapter/lib/active_record/connection_adapters/crate_adapter.rb:23:in `<top (required)>'
	 7: from /Users/niklasschmidtmer/Documents/GitHub/activerecord-crate-adapter/lib/active_record/connection_adapters/crate_adapter.rb:23:in `require'
	 6: from /Users/niklasschmidtmer/.rbenv/versions/2.7.8/lib/ruby/gems/2.7.0/gems/activerecord-4.2.11.3/lib/active_record/base.rb:16:in `<top (required)>'
	 5: from /Users/niklasschmidtmer/.rbenv/versions/2.7.8/lib/ruby/gems/2.7.0/gems/activesupport-4.2.11.3/lib/active_support/dependencies.rb:274:in `require'
	 4: from /Users/niklasschmidtmer/.rbenv/versions/2.7.8/lib/ruby/gems/2.7.0/gems/activesupport-4.2.11.3/lib/active_support/dependencies.rb:240:in `load_dependency'
	 3: from /Users/niklasschmidtmer/.rbenv/versions/2.7.8/lib/ruby/gems/2.7.0/gems/activesupport-4.2.11.3/lib/active_support/dependencies.rb:274:in `block in require'
	 2: from /Users/niklasschmidtmer/.rbenv/versions/2.7.8/lib/ruby/gems/2.7.0/gems/activesupport-4.2.11.3/lib/active_support/dependencies.rb:274:in `require'
	 1: from /Users/niklasschmidtmer/.rbenv/versions/2.7.8/lib/ruby/gems/2.7.0/gems/activesupport-4.2.11.3/lib/active_support/core_ext/object/duplicable.rb:106:in `<top (required)>'
/Users/niklasschmidtmer/.rbenv/versions/2.7.8/lib/ruby/gems/2.7.0/gems/activesupport-4.2.11.3/lib/active_support/core_ext/object/duplicable.rb:111:in `<class:BigDecimal>': undefined method `new' for BigDecimal:Class (NoMethodError)

Checklist

  • Link to issue this PR refers to (if applicable):
  • CLA is signed

@hammerhead hammerhead force-pushed the hammerhead/fix-rspec branch 2 times, most recently from e427f93 to 44e765b Compare February 19, 2024 08:55
@hammerhead hammerhead marked this pull request as ready for review February 19, 2024 08:56
@hammerhead hammerhead requested a review from amotl February 19, 2024 08:56
@hammerhead hammerhead mentioned this pull request Feb 19, 2024

spec.add_dependency('activerecord', '~> 4.1.0')
spec.add_dependency('arel', '>= 5.0.0')
spec.add_dependency('crate_ruby', '~> 0.2.0')
# https://github.com/ruby/bigdecimal#which-version-should-you-select
spec.add_dependency('bigdecimal', '~> 1.4')
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The usage of BigDecimal.new within activerecord itself currently blocks further Ruby version upgrades. As per that link above, Ruby 2.7 is the latest version still supporting BigDecimal.new.

@amotl
Copy link
Member

amotl commented Feb 19, 2024

Thank you very much!

@amotl amotl merged commit bd0d0f3 into main Feb 19, 2024
1 check passed
@amotl amotl deleted the hammerhead/fix-rspec branch February 19, 2024 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants