Simple default SCRAM login with:
test.rb
m = Mongo::Client.new(['127.0.0.1:27017'], :database => "admin", :user => "admin", :password => "XXXXX")
Gives error:
/Users/andrew/.rvm/gems/ruby-2.2-head/gems/mongo-2.0.1/lib/mongo/auth/scram/conversation.rb:182:in `initialize': uninitialized constant Mongo::Auth::SCRAM::Conversation::SecureRandom (NameError)
from /Users/andrew/.rvm/gems/ruby-2.2-head/gems/mongo-2.0.1/lib/mongo/auth/scram.rb:43:in `new'
from /Users/andrew/.rvm/gems/ruby-2.2-head/gems/mongo-2.0.1/lib/mongo/auth/scram.rb:43:in `login'
from /Users/andrew/.rvm/gems/ruby-2.2-head/gems/mongo-2.0.1/lib/mongo/server/connection.rb:64:in `connect!'
from /Users/andrew/.rvm/gems/ruby-2.2-head/gems/mongo-2.0.1/lib/mongo/server/connectable.rb:89:in `ensure_connected'
from /Users/andrew/.rvm/gems/ruby-2.2-head/gems/mongo-2.0.1/lib/mongo/server/connection.rb:130:in `write'
from /Users/andrew/.rvm/gems/ruby-2.2-head/gems/mongo-2.0.1/lib/mongo/server/connectable.rb:66:in `block in dispatch'
from /Users/andrew/.rvm/gems/ruby-2.2-head/gems/mongo-2.0.1/lib/mongo/loggable.rb:44:in `log'
from /Users/andrew/.rvm/gems/ruby-2.2-head/gems/mongo-2.0.1/lib/mongo/loggable.rb:65:in `log_debug'
from /Users/andrew/.rvm/gems/ruby-2.2-head/gems/mongo-2.0.1/lib/mongo/server/connectable.rb:65:in `dispatch'
from /Users/andrew/.rvm/gems/ruby-2.2-head/gems/mongo-2.0.1/lib/mongo/operation/read/query.rb:61:in `block in execute_message'
from /Users/andrew/.rvm/gems/ruby-2.2-head/gems/mongo-2.0.1/lib/mongo/server/connection_pool.rb:99:in `with_connection'
from /Users/andrew/.rvm/gems/ruby-2.2-head/gems/mongo-2.0.1/lib/mongo/server/context.rb:62:in `with_connection'
from /Users/andrew/.rvm/gems/ruby-2.2-head/gems/mongo-2.0.1/lib/mongo/operation/read/query.rb:60:in `execute_message'
from /Users/andrew/.rvm/gems/ruby-2.2-head/gems/mongo-2.0.1/lib/mongo/operation/read/query.rb:54:in `execute'
from /Users/andrew/.rvm/gems/ruby-2.2-head/gems/mongo-2.0.1/lib/mongo/collection/view.rb:163:in `send_initial_query'
from /Users/andrew/.rvm/gems/ruby-2.2-head/gems/mongo-2.0.1/lib/mongo/collection/view/iterable.rb:39:in `each'
Requiring 'securerandom' in 'lib/mongo/auth/scram/conversation.rb' seems to fix the problem.