Problems with Forum - Ruby 2.5.0 - initialize not define 'each' method

HI, I´m new, one weeks ago, I have on problem with the forum that does not working, so i try to cs_comments_service, then explain that I need to upgrade the ruby to 2.5.0, so I did.
But when i go to the directory: /edx/app/forum/cs_comments_service/
and then write command: /edx/app/forum/cs_comments_service# bundle exec rake search:initialize;

They give a message, like this:

/root/.rbenv/versions/2.5.7/lib/ruby/gems/2.5.0/gems/bundler-1.16.6/lib/bundler/rubygems_integration.rb:200: warning: constant Gem::ConfigMap is deprecated
/edx/app/forum/cs_comments_service/lib/tasks/kpis.rake:7: warning: already initialized constant ROOT
/edx/app/forum/cs_comments_service/lib/tasks/flags.rake:6: warning: previous definition of ROOT was here
/edx/app/forum/cs_comments_service/lib/tasks/deep_search.rake:7: warning: already initialized constant ROOT
/edx/app/forum/cs_comments_service/lib/tasks/kpis.rake:7: warning: previous definition of ROOT was here
W, [2020-05-01T13:53:52.088692 #5131] WARN – : NewRelic agent library not installed
/edx/app/forum/.gem/ruby/2.5.0/gems/elasticsearch-transport-1.1.2/lib/elasticsearch/transport/transport/base.rb:52: warning: constant ::Fixnum is deprecated
/edx/app/forum/.gem/ruby/2.5.0/gems/elasticsearch-transport-1.1.2/lib/elasticsearch/transport/transport/base.rb:54: warning: constant ::Fixnum is deprecated
/edx/app/forum/cs_comments_service/models/constants.rb:2: warning: already initialized constant COURSE_ID
/edx/app/forum/cs_comments_service/lib/tasks/db.rake:28: warning: previous definition of COURSE_ID was here
W, [2020-05-01T13:53:52.620833 #5131] WARN – : Overwriting existing field _id in class User.
W, [2020-05-01T13:53:52.684651 #5131] WARN – : MONGODB | Unsupported client option ‘max_retries’. It will be ignored.
W, [2020-05-01T13:53:52.684737 #5131] WARN – : MONGODB | Unsupported client option ‘retry_interval’. It will be ignored.
W, [2020-05-01T13:53:52.684761 #5131] WARN – : MONGODB | Unsupported client option ‘timeout’. It will be ignored.
rake aborted!
NoMethodError: undefined method each' for nil:NilClass /edx/app/forum/.gem/ruby/2.5.0/gems/mongo-2.5.3/lib/mongo/cluster.rb:192:in initialize’
/edx/app/forum/.gem/ruby/2.5.0/gems/mongo-2.5.3/lib/mongo/client.rb:454:in new' /edx/app/forum/.gem/ruby/2.5.0/gems/mongo-2.5.3/lib/mongo/client.rb:454:in create_from_addresses’
/edx/app/forum/.gem/ruby/2.5.0/gems/mongo-2.5.3/lib/mongo/client.rb:253:in initialize' /edx/app/forum/.gem/ruby/2.5.0/gems/mongoid-7.0.5/lib/mongoid/clients/factory.rb:64:in new’
/edx/app/forum/.gem/ruby/2.5.0/gems/mongoid-7.0.5/lib/mongoid/clients/factory.rb:64:in create_client' /edx/app/forum/.gem/ruby/2.5.0/gems/mongoid-7.0.5/lib/mongoid/clients/factory.rb:27:in create’
/edx/app/forum/.gem/ruby/2.5.0/gems/mongoid-7.0.5/lib/mongoid/clients.rb:69:in block in with_name' /edx/app/forum/.gem/ruby/2.5.0/gems/mongoid-7.0.5/lib/mongoid/clients.rb:68:in synchronize’
/edx/app/forum/.gem/ruby/2.5.0/gems/mongoid-7.0.5/lib/mongoid/clients.rb:68:in with_name' /edx/app/forum/.gem/ruby/2.5.0/gems/mongoid-7.0.5/lib/mongoid/persistence_context.rb:114:in client’
/edx/app/forum/.gem/ruby/2.5.0/gems/mongoid-7.0.5/lib/mongoid/clients/options.rb:78:in mongo_client' /edx/app/forum/cs_comments_service/app.rb:172:in <top (required)>’
/edx/app/forum/.gem/ruby/2.5.0/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:325:in require' /edx/app/forum/.gem/ruby/2.5.0/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:325:in block in require’
/edx/app/forum/.gem/ruby/2.5.0/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:291:in load_dependency' /edx/app/forum/.gem/ruby/2.5.0/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:325:in require’
/edx/app/forum/cs_comments_service/Rakefile:24:in `block in <top (required)>’
/edx/app/forum/.gem/ruby/2.5.0/gems/rake-12.0.0/exe/rake:27:in

So, thath the problem is like: NoMethodError: undefined method `each’ for nil:NilClass on the file cluster.rb, but i don not have any idea, what i need to edit. If you can explain with me. Thanks.