mongo: error while loading shared libraries:
libmozjs.so: cannot open shared object file: No such file or directory
This is caused because MongoDB uses XulRunner for it’s operations. (This is also why you see a bunch of X11 programs that are to be installed when using apt-get). XulRunner, however, contains this file, but is not loaded.
Solving the problem:
Make sure you have xulrunner installed (sudo apt-get install xulrunner-1.9.2) and add its path to ldconfig’s configuration files, which are in/etc/ld.so.conf.d. You could create a file, say, /etc/ld.so.conf.d/xulrunner.conf, containing the following line:
After this, you chould run ldconfig (as root) and that should do the trick. Let me know if you have any problems with this.