无法使用“流星蒙哥"连接到本地(运行中的)蒙哥 [英] Can't connect to local (running) mongo using 'meteor mongo'

查看:82
本文介绍了无法使用“流星蒙哥"连接到本地(运行中的)蒙哥的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在玩流星,已将其安装在Ubuntu 14.10&遵循了 todos教程.流星运行日志:

I'm playing with meteor, Installed it on Ubuntu 14.10 & followed the todos tutorial. The Meteor run log:

$ meteor run
[[[[[ ~/bckd/homedir/learn/meteor/mycoolapp ]]]]]

=> Started proxy.                             
=> Started MongoDB.                           
=> Started your app.                          

=> App running at: http://localhost:3000/

当我尝试通过另一个终端连接到mongo时,我得到:

When I try to connect to mongo via another terminal, I get:

$ meteor mongo
mongo: Meteor isn't running a local MongoDB server.
This command only works while Meteor is running your application locally. Start your
application first. (This error will also occur if you asked Meteor to use a different MongoDB
server with $MONGO_URL when you ran your application.)

If you're trying to connect to the database of an app you deployed with `meteor deploy`,
specify your site's name with this command.

试图解决此问题,我查看了mongo命令,很快我就知道可以使用以下命令进行连接:

Trying to work around this problem I looked at the mongo command, and soon enough I figured I can connect using:

$ mongo localhost:3001

太好了,这很有效,看来我暂时可以使用它.

So great, that's working and it seems that I am able to use that for the time being.

但是...为什么是官方方式:meteor mongo在我的设置中不起作用,我能做些什么来解决它?

But... why is the official way: meteor mongo not working in my setup, and can I do anything to fix it?

在我的ubuntu上创建另一个帐户,登录并创建一个新的应用程序之后,我运行它并设法通过meteor mongo命令(没有sudo)按预期的方式连接到mongo实例.我以为这可能是我的环境变量不同的结果,所以我比较了这两个变量(用env命令转储这两个环境.我的主帐户中有一些额外的bash变量,因此我逐个取消设置它们,直到我遇到了两个相同的环境(主目录值,用户名,gnome会话令牌的自动生成的值等),尽管有这些更改,但问题仍然存在.变得邪恶了,所以,我将其删除并重新安装了流星,这也不能解决问题.无论是什么问题,它都非常顽固.

After creating another account on my ubuntu, logging in and creating a new app, I run it and managed to connect to the mongo instance as intended with the meteor mongo command (without sudo). I thought it could be a result of a difference in my environment variables so I compared the two (dumping both environments with the env command. There were some extra bash variables in my primary account so one by one I've unset them until I reached two identical environments (with the exceptions of home directory values, user names, auto-generated values for gnome session tokens and such). Despite those changes, the problem consists. Another wild guess of mine was that the ~/.meteor folder has gone evil on me. So, I've removed it and reinstalled meteor. That didn't fix it either. Whatever the problem is, it's pretty stubborn.

推荐答案

尝试:

sudo meteor mongo

它在无业游民的盒子上为我工作:)

it worked for me on a Vagrant box :)

这篇关于无法使用“流星蒙哥"连接到本地(运行中的)蒙哥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆