25
Sep 09

Installing couchdb on Snow Leopard

Usually the process is pretty easy. If you have MacPorts, and if you don’t, I recommend you get it, you just type sudo port install couchdb.

With Snow Leopard, this installation is a bit broken. The port install works, but then you get an exception, something like Trace/BPT trap. It’s not really due to CouchDB, but rather one of its dependencies, SpiderMonkey (Mozilla’s embeddable JS engine written in C).

So here is a simple solution…

  sudo port install couchdb
  sudo port uninstall -f spidermonkey
  cd /tmp
  curl -O http://ftp.mozilla.org/pub/mozilla.org/js/js-1.7.0.tar.gz
  curl -O http://svn.macports.org/repository/macports/trunk/dports/lang/spidermonkey/files/patch-jsprf.c
  tar xvzf js-1.7.0.tar.gz
  cd js/src
  patch -p0 -i ../../patch-jsprf.c
  make -f Makefile.ref
  sudo su
  JS_DIST=/usr/local/spidermonkey make -f Makefile.ref export
  exit
  sudo ranlib /usr/local/spidermonkey/lib/libjs.a
  # if you get an error here, ignore it

  sudo ln -s /usr/local/spidermonkey/include /usr/local/include/js
  sudo ln -s /usr/local/spidermonkey/lib/libjs.dylib /usr/local/lib/libjs.dylib
  # If you're feeling saucey, the js shell can be useful for quick syntax checking and the like.
  sudo ln -s /usr/local/spidermonkey/bin/js /usr/local/bin/js

That’s it, you should be able to do sudo couchdb and it should run startup fine.

Let me know if you find any issues during this install and/or after.

Tags: ,

10 comments

  1. Thanks a bunch, just what I needed

  2. Thanks a bunch, just what I needed

  3. Works perfectly now, thanks.

  4. Works perfectly now, thanks.

  5. Worked as advertised, thanks a lot! And much easier than building everything from source.

  6. Worked as advertised, thanks a lot! And much easier than building everything from source.

  7. I had the feeling that I had missed some important part of the conversation. Was this more results of the brain fiddling–or just female conversation?

  8. I had the feeling that I had missed some important part of the conversation. Was this more results of the brain fiddling–or just female conversation?

Leave a comment