3
votes

I freshly created a new meteor (1.2.1) project like this (on a Debian 7.7) but I'm not able to enter the mongo terminal:

$ meteor create test
$ cd test
$ meteor run
[[[[[ ~/test ]]]]]                           

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

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

and in a new terminal:

$ 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 with 'meteor' and then run this
command in a new terminal. 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 as an argument to this
command.

Yes it is running a local MongoDB server!! What's wrong here, what shall I do? $MONGO_URL is empty btw. mongodb is installed, though, but not used (only need mongodump and mongorestore to connect to meteor's mongo).

Thanks

4
Those 4 commands above, did you run them all sequentially in one terminal session? i.e., did you stop the meteor run command (e.g. Cmd-C) before running meteor mongo? If so this doesn't work, as at that point meteor is not running. You need to run meteor mongo in a new terminal while meteor run is still executing. Otherwise, check what echo $MONGO_URL shows. - JeremyK
Yes I startet a new terminal while meteor run, sorry that was unclear. - quape
$MONGO_URL is empty btw - quape
in the new terminal, are you in the project directory? - JeremyK
jep i'm in the project dir - quape

4 Answers

1
votes

Got this error running windows 10. Funny thing is, meteor mongo was working before then all of a sudden it didn't work. I don't quite remember what i did but it could have been closing the terminal with the window close icon instead of ctrl+c.

Anyway what i did was run:

>meteor mongo localhost:3001

this output the following error

Sorry, Meteor does not yet support specific path URLs, such as http://www.example.com/blog . Please specify the root of a domain

And then I run the >meteor mongo command again and boom!! it works again.

0
votes

Wow, it turned out that it works when I don't use the cloud9 IDE terminal but connect directly. So eventually it was a ENV / terminal problem? I have no idea. But it works :-)

0
votes

I ran into the same problem when I ran meteor on port 80. To do that Ubuntu required root permissions to use the port. I then got the same error when running meteor mongo as a regular user.

To fix I just used sudo and it worked fine.

0
votes

It can happen if you are using CTRL+c for the same terminal in which meteor is running. This will close the meteor and you will not be able to connect with mongo.