Skip to content
This repository has been archived by the owner on Sep 3, 2021. It is now read-only.

Ruby 2.4 #498

Open
jawalonoski opened this issue May 31, 2017 · 19 comments
Open

Ruby 2.4 #498

jawalonoski opened this issue May 31, 2017 · 19 comments
Assignees

Comments

@jawalonoski
Copy link

Please add Ruby 2.4 support.

This gem does not build with Ruby 2.4, due to out of date dependencies, and the deprecation of Fixnum and Bignum within Ruby 2.4.

@preston
Copy link

preston commented May 31, 2017

This is unfortunately a blocker for downstream projects. Could someone take a look real quick?

@okeefm okeefm self-assigned this May 31, 2017
@okeefm
Copy link
Contributor

okeefm commented May 31, 2017

I'm taking a look at this now.

@okeefm
Copy link
Contributor

okeefm commented Jun 2, 2017

I've got a branch at https://github.com/projectcypress/health-data-standards/tree/ruby_24 if you want to give it a try.

@jawalonoski
Copy link
Author

Trying it out...

@jawalonoski
Copy link
Author

Running unit tests I got:

416 tests, 1967 assertions, 1 failures, 3 errors, 101 skips

@okeefm
Copy link
Contributor

okeefm commented Jun 2, 2017

Odd. I've run the tests a few times, and have gotten no failures/errors (the skips are expected). Can you post the tests that are failing?

@jawalonoski
Copy link
Author

Sure... however, pointing my project at this branch seems to work --- i.e. I can export C-CDA.

@jawalonoski
Copy link
Author

jawalonoski commented Jun 2, 2017

Looking at the stack trace, it seems to have to do with Mongoid version incompatibility.

Strangely, the C-CDAs still export.

TypeError:         TypeError: wrong argument type Integer (expected Proc)
            .rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/forwardable.rb:228:in `max_message_size'
            .rvm/gems/ruby-2.4.0/gems/mongo-2.4.2/lib/mongo/server/connection.rb:195:in `block in write'
            .rvm/gems/ruby-2.4.0/gems/mongo-2.4.2/lib/mongo/server/connection.rb:192:in `each'
            .rvm/gems/ruby-2.4.0/gems/mongo-2.4.2/lib/mongo/server/connection.rb:192:in `write'
            .rvm/gems/ruby-2.4.0/gems/mongo-2.4.2/lib/mongo/server/connection.rb:162:in `deliver'
            .rvm/gems/ruby-2.4.0/gems/mongo-2.4.2/lib/mongo/server/connection.rb:108:in `block in dispatch'
            .rvm/gems/ruby-2.4.0/gems/mongo-2.4.2/lib/mongo/monitoring/publishable.rb:47:in `publish_command'
            .rvm/gems/ruby-2.4.0/gems/mongo-2.4.2/lib/mongo/server/connection.rb:107:in `dispatch'
            .rvm/gems/ruby-2.4.0/gems/mongo-2.4.2/lib/mongo/operation/write/command/writable.rb:39:in `block in execute'
            .rvm/gems/ruby-2.4.0/gems/mongo-2.4.2/lib/mongo/server/connection_pool.rb:107:in `with_connection'
            .rvm/gems/ruby-2.4.0/gems/mongo-2.4.2/lib/mongo/server.rb:242:in `with_connection'
            .rvm/gems/ruby-2.4.0/gems/mongo-2.4.2/lib/mongo/operation/write/command/writable.rb:38:in `execute'
            .rvm/gems/ruby-2.4.0/gems/mongo-2.4.2/lib/mongo/operation/write/insert.rb:55:in `execute_write_command'
            .rvm/gems/ruby-2.4.0/gems/mongo-2.4.2/lib/mongo/operation/write/write_command_enabled.rb:41:in `execute'
            .rvm/gems/ruby-2.4.0/gems/mongo-2.4.2/lib/mongo/collection.rb:362:in `block in insert_one'
            .rvm/gems/ruby-2.4.0/gems/mongo-2.4.2/lib/mongo/retryable.rb:104:in `write_with_retry'
            .rvm/gems/ruby-2.4.0/gems/mongo-2.4.2/lib/mongo/collection.rb:353:in `insert_one'
            .rvm/gems/ruby-2.4.0/gems/mongoid-5.0.2/lib/mongoid/query_cache.rb:168:in `insert_one_with_clear_cache'
            git/health-data-standards/lib/health-data-standards/import/bundle/importer.rb:243:in `block (2 levels) in unpack_and_store_results'
            git/health-data-standards/lib/health-data-standards/import/bundle/importer.rb:233:in `each'
            git/health-data-standards/lib/health-data-standards/import/bundle/importer.rb:233:in `block in unpack_and_store_results'
            git/health-data-standards/lib/health-data-standards/import/bundle/importer.rb:222:in `each'
            git/health-data-standards/lib/health-data-standards/import/bundle/importer.rb:222:in `unpack_and_store_results'
            git/health-data-standards/lib/health-data-standards/import/bundle/importer.rb:61:in `block in import'
            .rvm/gems/ruby-2.4.0/gems/rubyzip-1.2.1/lib/zip/file.rb:101:in `open'
            git/health-data-standards/lib/health-data-standards/import/bundle/importer.rb:30:in `import'
            git/health-data-standards/test/unit/import/bundle/importer_test.rb:96:in `test_load'

bundle metadata unpacked...
  test_load_with_update                                          ERROR (0.09s)
TypeError:         TypeError: wrong argument type Integer (expected Proc)
            .rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/forwardable.rb:228:in `max_message_size'
            .rvm/gems/ruby-2.4.0/gems/mongo-2.4.2/lib/mongo/server/connectable.rb:114:in `block in read'
            .rvm/gems/ruby-2.4.0/gems/mongo-2.4.2/lib/mongo/server/connectable.rb:97:in `ensure_connected'
            .rvm/gems/ruby-2.4.0/gems/mongo-2.4.2/lib/mongo/server/connectable.rb:113:in `read'
            .rvm/gems/ruby-2.4.0/gems/mongo-2.4.2/lib/mongo/server/connection.rb:163:in `deliver'
            .rvm/gems/ruby-2.4.0/gems/mongo-2.4.2/lib/mongo/server/connection.rb:108:in `block in dispatch'
            .rvm/gems/ruby-2.4.0/gems/mongo-2.4.2/lib/mongo/monitoring/publishable.rb:47:in `publish_command'
            .rvm/gems/ruby-2.4.0/gems/mongo-2.4.2/lib/mongo/server/connection.rb:107:in `dispatch'
            .rvm/gems/ruby-2.4.0/gems/mongo-2.4.2/lib/mongo/operation/executable.rb:37:in `block in execute'
            .rvm/gems/ruby-2.4.0/gems/mongo-2.4.2/lib/mongo/server/connection_pool.rb:107:in `with_connection'
            .rvm/gems/ruby-2.4.0/gems/mongo-2.4.2/lib/mongo/server.rb:242:in `with_connection'
            .rvm/gems/ruby-2.4.0/gems/mongo-2.4.2/lib/mongo/operation/executable.rb:35:in `execute'
            .rvm/gems/ruby-2.4.0/gems/mongo-2.4.2/lib/mongo/collection/view/iterable.rb:81:in `send_initial_query'
            .rvm/gems/ruby-2.4.0/gems/mongo-2.4.2/lib/mongo/collection/view/iterable.rb:41:in `block in each'
            .rvm/gems/ruby-2.4.0/gems/mongo-2.4.2/lib/mongo/retryable.rb:43:in `read_with_retry'
            .rvm/gems/ruby-2.4.0/gems/mongo-2.4.2/lib/mongo/collection/view/iterable.rb:39:in `each'
            .rvm/gems/ruby-2.4.0/gems/mongoid-5.0.2/lib/mongoid/query_cache.rb:207:in `each'
            .rvm/gems/ruby-2.4.0/gems/mongoid-5.0.2/lib/mongoid/contextual/mongo.rb:121:in `each'
            .rvm/gems/ruby-2.4.0/gems/mongoid-5.0.2/lib/mongoid/contextual.rb:20:in `each'
            .rvm/gems/ruby-2.4.0/gems/mongoid-5.0.2/lib/mongoid/criteria/findable.rb:107:in `entries'
            .rvm/gems/ruby-2.4.0/gems/mongoid-5.0.2/lib/mongoid/criteria/findable.rb:107:in `from_database'
            .rvm/gems/ruby-2.4.0/gems/mongoid-5.0.2/lib/mongoid/criteria/findable.rb:75:in `multiple_from_db'
            .rvm/gems/ruby-2.4.0/gems/mongoid-5.0.2/lib/mongoid/criteria/findable.rb:19:in `execute_or_raise'
            .rvm/gems/ruby-2.4.0/gems/mongoid-5.0.2/lib/mongoid/criteria/findable.rb:40:in `find'
            .rvm/gems/ruby-2.4.0/gems/mongoid-5.0.2/lib/mongoid/findable.rb:93:in `find'
            git/health-data-standards/lib/health-data-standards/import/bundle/importer.rb:124:in `block (2 levels) in unpack_and_store_measures'
            .rvm/gems/ruby-2.4.0/gems/mongo-2.4.2/lib/mongo/collection/view/iterable.rb:45:in `block in each'
            .rvm/gems/ruby-2.4.0/gems/mongo-2.4.2/lib/mongo/cursor.rb:111:in `block in each'
            .rvm/gems/ruby-2.4.0/gems/mongo-2.4.2/lib/mongo/cursor.rb:111:in `each'
            .rvm/gems/ruby-2.4.0/gems/mongo-2.4.2/lib/mongo/cursor.rb:111:in `each'
            .rvm/gems/ruby-2.4.0/gems/mongo-2.4.2/lib/mongo/collection/view/iterable.rb:44:in `each'
            .rvm/gems/ruby-2.4.0/gems/mongoid-5.0.2/lib/mongoid/query_cache.rb:207:in `each'
            git/health-data-standards/lib/health-data-standards/import/bundle/importer.rb:123:in `block in unpack_and_store_measures'
            git/health-data-standards/lib/health-data-standards/import/bundle/importer.rb:114:in `each'
            git/health-data-standards/lib/health-data-standards/import/bundle/importer.rb:114:in `each_with_index'
            git/health-data-standards/lib/health-data-standards/import/bundle/importer.rb:114:in `unpack_and_store_measures'
            git/health-data-standards/lib/health-data-standards/import/bundle/importer.rb:58:in `block in import'
            .rvm/gems/ruby-2.4.0/gems/rubyzip-1.2.1/lib/zip/file.rb:101:in `open'
            git/health-data-standards/lib/health-data-standards/import/bundle/importer.rb:30:in `import'
            git/health-data-standards/test/unit/import/bundle/importer_test.rb:71:in `test_load_with_update'

bundle metadata unpacked...
Loading: Measures Complete          
Loading: patients 17% completewrong argument type Integer (expected Proc)
  test_load_same_version_with_delete                              FAIL (0.55s)
Minitest::Assertion:         Should not have errored attempting to load db with same version of bundle with delete existing
        git/health-data-standards/test/unit/import/bundle/importer_test.rb:65:in `rescue in test_load_same_version_with_delete'
        git/health-data-standards/test/unit/import/bundle/importer_test.rb:53:in `test_load_same_version_with_delete'

bundle metadata unpacked...
Loading: Measures Complete          
Loading: Patients Complete          
Loading: Value Sets Complete          
  test_load_without_update                                       ERROR (2.19s)
TypeError:         TypeError: wrong argument type Integer (expected Proc)
            .rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/forwardable.rb:228:in `cluster'
            .rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/forwardable.rb:222:in `next_primary'
            .rvm/gems/ruby-2.4.0/gems/mongo-2.4.2/lib/mongo/collection.rb:362:in `block in insert_one'
            .rvm/gems/ruby-2.4.0/gems/mongo-2.4.2/lib/mongo/retryable.rb:104:in `write_with_retry'
            .rvm/gems/ruby-2.4.0/gems/mongo-2.4.2/lib/mongo/collection.rb:353:in `insert_one'
            .rvm/gems/ruby-2.4.0/gems/mongoid-5.0.2/lib/mongoid/query_cache.rb:168:in `insert_one_with_clear_cache'
            git/health-data-standards/lib/health-data-standards/import/bundle/importer.rb:243:in `block (2 levels) in unpack_and_store_results'
            git/health-data-standards/lib/health-data-standards/import/bundle/importer.rb:233:in `each'
            git/health-data-standards/lib/health-data-standards/import/bundle/importer.rb:233:in `block in unpack_and_store_results'
            git/health-data-standards/lib/health-data-standards/import/bundle/importer.rb:222:in `each'
            git/health-data-standards/lib/health-data-standards/import/bundle/importer.rb:222:in `unpack_and_store_results'
            git/health-data-standards/lib/health-data-standards/import/bundle/importer.rb:61:in `block in import'
            .rvm/gems/ruby-2.4.0/gems/rubyzip-1.2.1/lib/zip/file.rb:101:in `open'
            git/health-data-standards/lib/health-data-standards/import/bundle/importer.rb:30:in `import'
            git/health-data-standards/test/unit/import/bundle/importer_test.rb:84:in `test_load_without_update'

@okeefm
Copy link
Contributor

okeefm commented Jun 2, 2017

Weird. I'm using mongoDB 3.4.4. Not sure if yours is any different.

@preston
Copy link

preston commented Jun 2, 2017

Maybe try recompiling/reinstalling the driver gem? I've had issues with natively-compiled drivers and rvm after system upgrades in the past.

@preston
Copy link

preston commented Jun 6, 2017

@okeefm Just checking in if any other clues have come up? I'm on macOS 10.12.x and have this error on multiple machines.

@okeefm
Copy link
Contributor

okeefm commented Jun 6, 2017

@preston can you confirm which version of Ruby 2.4 you're using? 2.4.0, or 2.4.1?

@preston
Copy link

preston commented Jun 6, 2017

I've tried both.

@okeefm
Copy link
Contributor

okeefm commented Jun 6, 2017

Odd. This ticket seems to suggest it was an issue in Ruby 2.4.0, which was fixed in 2.4.1. I will continue investigating. DatabaseCleaner/database_cleaner#466

@preston
Copy link

preston commented Jun 6, 2017

Ok, I'm going to try completely reinstalling/recompiling my installation then. @jawalonoski: are you still seeing this on Ruby 2.4.1?

@okeefm
Copy link
Contributor

okeefm commented Jun 6, 2017

I'm also going to try installing 2.4.0 to see if I can reproduce.

@okeefm
Copy link
Contributor

okeefm commented Jun 6, 2017

I am seeing the errors above when I run the test suite with 2.4.0.

@preston
Copy link

preston commented Jun 6, 2017

Same issue after reinstalling. Upon closer inspection it looks like there are numerous issues related to some really outdated dependencies in both the Gemfile and .gemspec. It looks like mongoid v4.x pegs activesupport to 4.x as well, and updating to the current v6.x release ends up requiring stuff that protected_attributes doesn't support. Using mongoid v5.x as a stepping stone seem to be make the dependency tree happy, however, and also seems to pass the unit tests.

I'll submit a PR shortly (as well as an updated .travis.yml) that I think should help. :)

@preston
Copy link

preston commented Jun 6, 2017

@jawalonoski This PR fixes my downstream issue with synthea at synthetichealth/synthea#200 when using my health-data-standards branch at https://github.com/preston/health-data-standards . I'll submit a synthea PR to use the alternate branch for now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants