0

I've been following this tutorial to install Rocket.Chat on Ubuntu:

https://github.com/RocketChat/Rocket.Chat/wiki/Deploy-Rocket.Chat-without-docker

Everything looks good until I try to run the server with node main.js:

Error: failed to connect to [localhost:27017] at Object.Future.wait (/home/gregoire/Rocket.Chat/programs/server/node_modules/fibers/future.js:398:15) at new MongoConnection (packages/mongo/mongo_driver.js:213:1)

localhost could also be 127.0.0.1 or my IP address, it doesn't change anything. Sounds like an error coming from MongoDB.

So I tried to run with sudo and the error I'm getting is different:

Error: MONGO_URL must be set in environment

I follow the tutorial, this variable has been set using export:

export ROOT_URL=http://localhost/ export MONGO_URL=mongodb://localhost:27017/rocketchat export PORT=80

EDIT:

I needed to start mongod to then run the main.js. But I also got an error:

mongodb failed to connect to 127.0.0.1

I made some research and found that I had a missing folder. I used this command to create it and then started mongod:

mkdir -p /data/db

It worked after that, but it's not implied in the tutorial. I'm currently repeating the setup on a server and I'm having the same problem: /data/db is missing.

Marcelo Schmidt
  • 609
  • 4
  • 15
Grégoire Borel
  • 1,880
  • 3
  • 33
  • 55
  • Did you have to run the commands from "Install Dependencies"? I thought that when you installed mongoDB, it would automatically create /data/db for you... Is it not the case? What's your OS version? – Marcelo Schmidt Jan 15 '16 at 16:19
  • Ubuntu 15.10. I installed mongoDB using the commands given in the tutorial. – Grégoire Borel Jan 15 '16 at 16:20

1 Answers1

3

Disclaimer: I work for Rocket.Chat.

Are you sure mongodb is running? Can you type mongo and see if you can get into a mongoDB shell? If it's running, can you please confirm it's running on port 27017?

You can also go to https://demo.rocket.chat and join #support channel or #dev, where you'll find quite a few developers willing to help you out.

Marcelo Schmidt
  • 609
  • 4
  • 15
  • I can't run `mongo`. I was able to make it work by creating a missing folder: `sudo mkdir -p /data/db`. I'm not sure if this is a clean solution though. – Grégoire Borel Jan 15 '16 at 14:59
  • 1
    This doesn't seem right at all! You can't run `mongo` because you are not allowed to, or because it is not running on your system? It's impossible to use Rocket.Chat without MongoDB, so I'm guessing it's the first option. – Marcelo Schmidt Jan 15 '16 at 15:13
  • We have a new docs for installing on Ubuntu, without Docker. Please check out at: https://github.com/RocketChat/Rocket.Chat.Docs/blob/master/3.%20Installation/4.%20Manual%20Installation/Ubuntu/README.md – Marcelo Schmidt Jun 03 '16 at 14:58