Error mongoDB under Ubuntu – can’t find libmozjs.so

Posted by Michael Hendrickx on September 27, 2010
misc, sysadmin

When installing MongoDB under Ubuntu, one could stumble upon the following problem:

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:

/usr/lib/xulrunner-1.9.2.10/

After this, you chould run ldconfig (as root) and that should do the trick. Let me know if you have any problems with this.

Tags: , , ,

2 Comments to Error mongoDB under Ubuntu – can’t find libmozjs.so

Abhishek
November 22, 2010

Hello there,

I tried making the file xulrunner.conf and running Mongo again but to no success.

Any hint?

Abhishek
November 22, 2010

I found the workaround that btw,

here it is: https://bugs.launchpad.net/ubuntu/+source/mongodb/+bug/557024

Thanks for your effort!

Leave a comment

WP_Big_City