fixing "libmozjs" missing when using mongodb on Ubuntu lucid

Tue 13 July 2010
  • 把戏 tags:
  • mongodb
  • ubuntu published: true comments: true

Problem When running mongod/mongo/mongos, you got message like this: mongod: error while loading shared libraries: libmozjs.so: cannot open shared object file: No such file or directory

Solution Make sure you have xulrunner-dev installed: sudo apt-get install xulrunner-dev

then find libmozjs on your filesystem: sudo locate libmozjs

in lucid, it's supposed to locate at: /usr/lib/xulrunner-1.9.2.6/libmozjs.so

(and some other directories, such as firefox / thunderbird / seamonkey)

Just create a symbol link: sudo ln -s /usr/lib/xulrunner-1.9.2.6/libmozjs.so /usr/lib/

try to restart mongodb: sudo service mongodb start

take a look at process list: ps aux | grep mongo

it works.

The post is brought to you by lekhonee v0.7