私の目標はheroku/mongolabデータベースに接続することですが、次のエラーが発生し続けます。
Mongo::OperationFailure at /mongotest/a/b
: need to login
file: networking.rb
location: send_message_with_gle
line: 89
私が使用しているコードは次のとおりです。
client = Mongo::MongoClient.from_uri(ENV['MONGOLAB_URI'])
db = client.db('test')
testcoll = db['testcoll']
testcoll.insert({:'_id' => "def", :'test' => "woop de doop"})
testcoll.find()
ENV['MONGOLAB_URI']=mongodb://heroku_app########:password@ds0xxxxx.mongolab.com:xxxxx/heroku_app########
uriが正しく、ユーザー名とパスワードが含まれていることを知っているのに、なぜエラーが発生するのでしょうか。また、エラーは、認証した行ではなく、insert()行で発生します。