简体   繁体   English

启动 MongoDB : ./bin/mongod 没有那个文件或目录

[英]Starting MongoDB : ./bin/mongod No such file or directory

After installing MongoDB with ruby gems使用 ruby​​ gems 安装 MongoDB 后

 gem install mongodb

In my user/sites directory, I did在我的用户/站点目录中,我做了

sudo mkdir -p /data/db/  
sudo chown `id -u` /data/db  

However, this didn't create those directories in user/sites.但是,这并没有在用户/站点中创建这些目录。 I had to back up a few levels to access them.我必须备份几个级别才能访问它们。

the instructions I am following then told me to我遵循的说明然后告诉我

cd to your MongoDB bin directory or type in the complete path to it. You'll need to start mongod.

$ ./bin/mongod 

I did this command inside user/sites and also, after backing up a few levels, inside the data directory, and inside the data/db directory.我在 user/sites 中执行了这个命令,并且在备份了几个级别之后,在 data 目录中,在 data/db 目录中。 However, each time I got然而,每次我得到

./bin/mongod: No such file or directory

1st question: Know what's wrong?第一个问题:知道有什么问题吗?

Once and if I get that to work, I will have to do this to start the mongo shell一次,如果我让它工作,我将不得不这样做来启动 mongo shell

./bin/mongo  

2nd question: where will i run that command?第二个问题:我将在哪里运行该命令?

I had the same problem.我有同样的问题。 It turned out i was using the 32bit version of mongo on a 64 bit ubuntu machine.结果我在 64 位 ubuntu 机器上使用了 32 位版本的 mongo。

I got this from the link below:我从下面的链接中得到了这个:

https://groups.google.com/forum/?fromgroups=#!topic/mongodb-user/b8rhUllEhlA https://groups.google.com/forum/?fromgroups=#!topic/mongodb-user/b8rhUllEhlA

Are you sure installing mongo as a Ruby gem actually installs MongoDB?您确定将 mongo 安装为 Ruby gem 确实会安装 MongoDB? Looks to me like you're only installing the ruby driver.在我看来,您只是在安装 ruby​​ 驱动程序。 Here's some docs on how to install MongoDB .这里有一些关于如何安装 MongoDB 的文档。

错误的路径:

$ sudo chown -R sqy1 /Users/sqy1/data/db

If you are on windows go to git bash/cmd then type "cd" , that will bring you to root directory then type "mongod" and press type, this must start you mongoDB.如果您在 Windows 上,请转到 git bash/cmd 然后输入 "cd" ,这会将您带到根目录,然后输入 "mongod" 并按 type,这必须启动您的 mongoDB。 I did this and it worked我这样做了,它奏效了

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM