MOPED:无法解析IP:localhost:27017(rails)

时间:2016-05-26 16:38:02

标签: ruby-on-rails ruby windows mongodb localhost

我正在尝试学习Ruby以及如何将它连接到MongoDB。

我已经关注了this video的所有内容,当我尝试连接到localhost:3000时出现以下错误

MOPED: Could not resolve IP for: localhost:27017, delta is 30.624691, error class is #<Resolv::ResolvError: Resolv::ResolvError>, retries is 0. Node is <Moped::Node resolved_address=nil> runtime: n/a

令我感到困惑的是,它正在努力连接到本地主机,这让我疯了!

请您指导我如何解决这个问题?

谢谢!

PS:我在Windows机器上运行Rails

1 个答案:

答案 0 :(得分:1)

打开命令提示符并运行C:\mongodb\bin\mongod.exe,然后打开另一个命令提示符并运行C:\mongodb\bin\mongo.exe