How do I fix “Error: MONGO_URL must be set in environment” on ubuntu using forever and startup script?

[亡魂溺海] 提交于 2019-12-04 09:06:27

it looks to me as if you forgot the colon ´:´ in your mongourl

export PORT=80 MONGO_URL=mongodb://localhost:27017/parties ROOT_URL=http://ec2-54-235-1-185.compute-1.amazonaws.com

have you tried that?

Try passing it onto forever straight without using the export before:

exec PORT=80 MONGO_URL=mongodb://localhost27017/parties ROOT_URL=http://ec2-54-235-1-185.compute-1.amazonaws.com forever start bundle/main.js

It might have something to do with the permissions, when using a startup script the user might be something that has its own variable scope to the ones set.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!