I am getting this error while attempting to use this adapter.
Mongo::ConfigurationError: Trying to connect directly to slave; if
this is what you want, specify :slave_ok => true.
from /home/abhishiv/.rvm/gems/ruby-1.9.2-p136/gems/mongo-0.18.3/lib/
mongo/connection.rb:317:in `block in connect_to_master'
from /home/abhishiv/.rvm/gems/ruby-1.9.2-p136/gems/mongo-0.18.3/lib/
mongo/connection.rb:303:in `each'
from /home/abhishiv/.rvm/gems/ruby-1.9.2-p136/gems/mongo-0.18.3/lib/
mongo/connection.rb:303:in `connect_to_master'
from /home/abhishiv/.rvm/gems/ruby-1.9.2-p136/gems/mongo-0.18.3/lib/
mongo/connection.rb:121:in `initialize'
from /home/abhishiv/.rvm/gems/ruby-1.9.2-p136/gems/dm-mongo-
adapter-0.2.0.pre3/lib/mongo_adapter/adapter.rb:249:in `new'
from /home/abhishiv/.rvm/gems/ruby-1.9.2-p136/gems/dm-mongo-
adapter-0.2.0.pre3/lib/mongo_adapter/adapter.rb:249:in `connection'
from /home/abhishiv/.rvm/gems/ruby-1.9.2-p136/gems/dm-mongo-
adapter-0.2.0.pre3/lib/mongo_adapter/adapter.rb:227:in `database'
from /home/abhishiv/.rvm/gems/ruby-1.9.2-p136/gems/dm-mongo-
adapter-0.2.0.pre3/lib/mongo_adapter/adapter.rb:208:in
`with_collection'
from /home/abhishiv/.rvm/gems/ruby-1.9.2-p136/gems/dm-mongo-
adapter-0.2.0.pre3/lib/mongo_adapter/adapter.rb:39:in `read'
from /home/abhishiv/.rvm/gems/ruby-1.9.2-p136/gems/dm-core-0.10.2/lib/
dm-core/repository.rb:145:in `read'
from /home/abhishiv/.rvm/gems/ruby-1.9.2-p136/gems/dm-core-0.10.2/lib/
dm-core/model.rb:353:in `last'
from (irb):1
from /home/abhishiv/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.0.3/lib/
rails/commands/console.rb:44:in `start'
from /home/abhishiv/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.0.3/lib/
rails/commands/console.rb:8:in `start'
from /home/abhishiv/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.0.3/lib/
rails/commands.rb:23:in `<top (required)>'
from script/rails:6:in `require'
Anyone has an idea why? Using it with mongohq
DataMapper.setup :default, "mongo://xxx:x...@flame.mongohq.com:xx/
app40xxx9"
In Gemfile
dm-mongo-adapter (0.2.0.pre3)
dm-aggregates (~> 0.10.2)
dm-core (~> 0.10.2)
mongo (~> 0.18.3)
mongo_ext (~> 0.18.3)
Btw seems like developments in this is stalled. Is it true? DM with
mongo makes so much sense because of the ability to have cross
database relationships.