mongoid / mongoid_fulltext

An n-gram-based full-text search implementation for the Mongoid ODM.
MIT License
150 stars 66 forks source link

Add support for Ruby 2.4.0 #30

Closed dblock closed 6 years ago

dblock commented 7 years ago

Seems non-trivial. Even with this:

  gem 'mongo', github: 'mongodb/mongo-ruby-driver' if RUBY_VERSION >= '2.4.0'
  gem 'bson', github: 'mongodb/bson-ruby' if RUBY_VERSION >= '2.4.0'
      TypeError:
        wrong argument type Integer (expected Proc)
      # /Users/dblock/.rvm/gems/ruby-2.4.0/bundler/gems/mongo-ruby-driver-dd19e48bbb72/lib/mongo/server/connection.rb:193:in `block in write'
      # /Users/dblock/.rvm/gems/ruby-2.4.0/bundler/gems/mongo-ruby-driver-dd19e48bbb72/lib/mongo/server/connection.rb:192:in `each'
      # /Users/dblock/.rvm/gems/ruby-2.4.0/bundler/gems/mongo-ruby-driver-dd19e48bbb72/lib/mongo/server/connection.rb:192:in `write'
      # /Users/dblock/.rvm/gems/ruby-2.4.0/bundler/gems/mongo-ruby-driver-dd19e48bbb72/lib/mongo/server/connection.rb:162:in `deliver'
      # /Users/dblock/.rvm/gems/ruby-2.4.0/bundler/gems/mongo-ruby-driver-dd19e48bbb72/lib/mongo/server/connection.rb:108:in `block in dispatch'
      # /Users/dblock/.rvm/gems/ruby-2.4.0/bundler/gems/mongo-ruby-driver-dd19e48bbb72/lib/mongo/monitoring/publishable.rb:47:in `publish_command'
      # /Users/dblock/.rvm/gems/ruby-2.4.0/bundler/gems/mongo-ruby-driver-dd19e48bbb72/lib/mongo/server/connection.rb:107:in `dispatch'
      # /Users/dblock/.rvm/gems/ruby-2.4.0/bundler/gems/mongo-ruby-driver-dd19e48bbb72/lib/mongo/operation/executable.rb:37:in `block in execute'
      # /Users/dblock/.rvm/gems/ruby-2.4.0/bundler/gems/mongo-ruby-driver-dd19e48bbb72/lib/mongo/server/connection_pool.rb:107:in `with_connection'
      # /Users/dblock/.rvm/gems/ruby-2.4.0/bundler/gems/mongo-ruby-driver-dd19e48bbb72/lib/mongo/server.rb:242:in `with_connection'
      # /Users/dblock/.rvm/gems/ruby-2.4.0/bundler/gems/mongo-ruby-driver-dd19e48bbb72/lib/mongo/operation/executable.rb:35:in `execute'
      # /Users/dblock/.rvm/gems/ruby-2.4.0/bundler/gems/mongo-ruby-driver-dd19e48bbb72/lib/mongo/operation/commands/collections_info.rb:51:in `execute'
      # /Users/dblock/.rvm/gems/ruby-2.4.0/bundler/gems/mongo-ruby-driver-dd19e48bbb72/lib/mongo/database/view.rb:114:in `send_initial_query'
      # /Users/dblock/.rvm/gems/ruby-2.4.0/bundler/gems/mongo-ruby-driver-dd19e48bbb72/lib/mongo/database/view.rb:95:in `collections_info'
      # /Users/dblock/.rvm/gems/ruby-2.4.0/bundler/gems/mongo-ruby-driver-dd19e48bbb72/lib/mongo/database/view.rb:55:in `collection_names'
      # /Users/dblock/.rvm/gems/ruby-2.4.0/bundler/gems/mongo-ruby-driver-dd19e48bbb72/lib/mongo/database.rb:116:in `collection_names'
      # /Users/dblock/.rvm/gems/ruby-2.4.0/bundler/gems/mongo-ruby-driver-dd19e48bbb72/lib/mongo/database.rb:140:in `collections'
      # /Users/dblock/.rvm/gems/ruby-2.4.0/gems/mongoid-6.0.3/lib/mongoid/config.rb:175:in `purge!'
      # /Users/dblock/.rvm/gems/ruby-2.4.0/gems/mongoid-6.0.3/lib/mongoid.rb:99:in `purge!'
      # ./spec/spec_helper.rb:20:in `block (2 levels) in <top (required)>'
Fudoshiki commented 7 years ago

https://github.com/mongodb/mongo-ruby-driver/pull/847, https://bugs.ruby-lang.org/issues/13107, this is bug in MRI 2.4.0, fixed in ruby-head, same issue https://github.com/DatabaseCleaner/database_cleaner/issues/466, waiting for 2.4.1 with fix

dblock commented 6 years ago

This works now.