Mongoid3 / Moped:database = admin command = {:ismaster => 1}

时间:2012-11-25 07:51:38

标签: ruby-on-rails mongodb mongoid moped database

我已将我的Rails应用程序升级到3.2.8和Mongoid 3 / Moped。开发时,我的开发机器上的所有东西都可以正常工作,而rails c也适用于我的生产设置。但是,应用程序无法启动(部署在乘客上)并且似乎只是超时,不会产生任何错误。我将log_level设置为在生产中调试,这就是我所看到的:

Creating scope :near. Overwriting existing method City.near.
  MOPED: 127.0.0.1:27017 COMMAND      database=admin command={:ismaster=>1} (5.8458ms)
  MOPED: 127.0.0.1:27017 COMMAND      database=admin command={:ismaster=>1} (8.2316ms)
  MOPED: 127.0.0.1:27017 COMMAND      database=admin command={:ismaster=>1} (16.2363ms)
  MOPED: 127.0.0.1:27017 COMMAND      database=admin command={:ismaster=>1} (13.0076ms)
  MOPED: 127.0.0.1:27017 COMMAND      database=admin command={:ismaster=>1} (1.5557ms)
  MOPED: 127.0.0.1:27017 COMMAND      database=admin command={:ismaster=>1} (1.5068ms)
  MOPED: 127.0.0.1:27017 COMMAND      database=admin command={:ismaster=>1} (1.5004ms)
  MOPED: 127.0.0.1:27017 COMMAND      database=admin command={:ismaster=>1} (1.7371ms)
  MOPED: 127.0.0.1:27017 COMMAND      database=admin command={:ismaster=>1} (1.7002ms)
  MOPED: 127.0.0.1:27017 COMMAND      database=admin command={:ismaster=>1} (2.8868ms)
  MOPED: 127.0.0.1:27017 COMMAND      database=admin command={:ismaster=>1} (1.8172ms)
  MOPED: 127.0.0.1:27017 COMMAND      database=admin command={:ismaster=>1} (3.0932ms)
  MOPED: 127.0.0.1:27017 COMMAND      database=admin command={:ismaster=>1} (10.4055ms)
  MOPED: 127.0.0.1:27017 COMMAND      database=admin command={:ismaster=>1} (1.5655ms)
  MOPED: 127.0.0.1:27017 COMMAND      database=admin command={:ismaster=>1} (1.4858ms)
  MOPED: 127.0.0.1:27017 COMMAND      database=admin command={:ismaster=>1} (1.6346ms)
  MOPED: 127.0.0.1:27017 COMMAND      database=admin command={:ismaster=>1} (1.4541ms)
  MOPED: 127.0.0.1:27017 COMMAND      database=admin command={:ismaster=>1} (1.5333ms)
  MOPED: 127.0.0.1:27017 COMMAND      database=admin command={:ismaster=>1} (1.8239ms)
  MOPED: 127.0.0.1:27017 COMMAND      database=admin command={:ismaster=>1} (1.5938ms)
  MOPED: 127.0.0.1:27017 COMMAND      database=admin command={:ismaster=>1} (1.4448ms)
  MOPED: 127.0.0.1:27017 COMMAND      database=admin command={:ismaster=>1} (1.4253ms)
  MOPED: 127.0.0.1:27017 COMMAND      database=admin command={:ismaster=>1} (9.8593ms)
# ... this just carries on indefinitely.

我该如何解决这个问题? (对于记录,我尝试使用的数据库不称为管理员。)

谢谢,

Avishai

1 个答案:

答案 0 :(得分:1)

好吧,看起来Passenger实际上是在旧的ruby 1.9.2安装上运行。将Passenger更新为ruby 1.9.3,重新编译nginx,然后再次正常工作。