ruby-on-rails - 卡住试图连接到我的 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”命令,即使我手动将它添加到路径中。
这里的想法用完了
解决方案
推荐阅读
- javascript - JSON 数组和对象长度在 Chrome 和 Internet Explorer 中的处理方式不同
- python - 如何删除python中的最后一个打印行?
- sql - SQL Server:如何在多个选择中获取行号
- android - 更新到 Android 8.0 或 8.1 后,Cordova 应用 ANR 仅适用于 Galaxy 设备的触摸事件
- javascript - 将Javascript中字符串变量的内容分成两部分并在两个不同的div中打印
- django - 无法在 pipenv shell 中运行 Django
- javascript - 如果 React 中不存在 JSON 键,如何隐藏 HTML 元素
- sql - 具有时间间隔的 CTE 上的慢速 LEFT JOIN
- javascript - 从firebase auth ui电话号码认证系统保存已验证的电话号码
- algorithm - 使用0/1背包的逻辑递归解无界背包