Can't connect to local (running) mongo using 'meteor mongo'

前端 未结 7 569
醉酒成梦
醉酒成梦 2021-01-19 16:59

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/         


        
7条回答
  •  太阳男子
    2021-01-19 17:20

    This worked for me with the same problem.

    I had two terminals open: one running with meteor command, the other terminal I tried meteor mongo and received the very same message as stated in the question.

    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.

    I tried the sudo command, which did not work as well.

    Here is what worked for me.

    1. Goto running meteor server terminal and ctrl-c (shut down server).
    2. In meteor server terminal type: meteor mongo. Note: In my case the command worked and the terminal entered into mongo.
    3. Type exit to exit mongo.
    4. Type meteor to spool back up meteor server.
    5. Goto meteor mongo terminal and type: meteor mongo. Note: For me, Meteor was running in the other terminal and meteor mongo command did open meteor mongo for me without error.

    Perhaps the something in Meteor needs to reboot which does not occur without shutting down meteor server first?

提交回复
热议问题