首页 > 解决方案 > 卡住试图连接到我的 mongodb 服务器

问题描述

我已经尝试了很多东西,但似乎没有任何效果。我刚刚开始按照手册指定安装 mongodb。我可以启动我的服务器,但是当我尝试打开任何需要数据库的页面时,我得到了这个:

Started GET "/posts" for ::1 at 2021-09-13 22:08:50 -0400
Processing by PostsController#index as HTML
  Rendering layout layouts/application.html.erb
  Rendering posts/index.html.erb within layouts/application
MONGODB | Topology type 'unknown' initializing.
MONGODB | There was a change in the members of the 'Unknown' topology.
MONGODB | Server localhost:27017 initializing.
MONGODB | Waiting for up to 3.00 seconds for servers to be scanned: #<Cluster topology=Unknown[localhost:27017] servers=[#<Server address=localhost:27017 UNKNOWN>]>
MONGODB | Error checking localhost:27017: Mongo::Error::SocketError: Errno::ECONNREFUSED: Connection refused - connect(2) for 127.0.0.1:27017 (for 127.0.0.1:27017 (no TLS)) (on localhost:27017)
MONGODB | Server description for localhost:27017 changed from 'unknown' to 'unknown'.
MONGODB | There was a change in the members of the 'Unknown' topology.

我能够连接到 Atlas 数据库,但这个项目需要一个本地数据库。我确认与我的防病毒软件或防火墙无关。我无法尝试通过 mongosh 连接。它只是无法识别“mongosh”命令,即使我手动将它添加到路径中。

这里的想法用完了

标签: ruby-on-railsmongodbmongo-shell

解决方案


推荐阅读