我对 MongoDB 有疑问。
首先,在运行时mongod
,然后mongo
(在另一个终端窗口中),我得到:
MongoDB shell version: 2.2.2
connecting to: test
>
>
然而。当我输入rails console
我的 Heroku 应用程序终端时,我得到:
Failed to connect to a master node at 127.0.0.1:9100 (Mongo::ConnectionFailure)
from /Users/musetr/.rvm/gems/ruby-1.9.3-p327@rails3tutorial2ndEd/gems/mongo-1.6.4/lib/mongo/connection.rb:594:in `setup'
from /Users/musetr/.rvm/gems/ruby-1.9.3-p327@rails3tutorial2ndEd/gems/mongo-1.6.4/lib/mongo/connection.rb:130:in `initialize'
from /Users/mmusetr/.rvm/gems/ruby-1.9.3-p327@rails3tutorial2ndEd/gems/mongo_mapper-0.12.0/lib/mongo_mapper/connection.rb:79:in `new'
from /Users/musetr/.rvm/gems/ruby-1.9.3-p327@rails3tutorial2ndEd/gems/mongo_mapper-0.12.0/lib/mongo_mapper/connection.rb:79:in `connect'
from /Users/musetr/.rvm/gems/ruby-1.9.3-p327@rails3tutorial2ndEd/gems/mongo_mapper-0.12.0/lib/mongo_mapper/connection.rb:89:in `setup'
.. 任何帮助将不胜感激。