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

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.


Posted

in

,

by

Comments

2 responses to “Error mongoDB under Ubuntu – can’t find libmozjs.so”

  1. Abhishek Avatar
    Abhishek

    Hello there,

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

    Any hint?

  2. Abhishek Avatar
    Abhishek

    I found the workaround that btw,

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

    Thanks for your effort!

Leave a Reply

Your email address will not be published. Required fields are marked *