Support Cut Asian Babies

Building CouchDB on OS X

Posted by Jake Good
on Sep 18, 07

Here’s how I got CouchDB to easily install on OS X.



Requirements: MacPorts installed.




1. sudo port install erlang
2. sudo port install icu
3. svn checkout http://couchdb.googlecode.com/svn/trunk couchdb && cd couchdb
4. export ERLANG_BIN_DIR=/opt/local/bin
5. export ERLANG_INCLUDE_DIR=/opt/local/lib/erlang/usr/include/
6. export UNICODE_INCLUDE_DIR=/opt/local/include
7. export UNICODE_LIB_DIR=/opt/local/lib
8. ./build.sh | tee build.log
9. sudo ./build.sh --install=/usr/local | tee install.log
10. sudo chown -R jake:jake /usr/local/couchdb/ ** NOTE: replace jake with your username
11. chmod +x /usr/local/couchdb/bin/couch_erl
12. /usr/local/couchdb/bin/startCouchDb.sh ** NOTE: you should see "CouchDb has started. Time to Relax."
13. visit: http://localhost:8888/
14. **BONUS!** edit .profile and add: alias couchdb="/usr/local/couchdb/bin/startCouchDb.sh"


Some resources I used to compile this:



evang.eli.st Building and Installing CouchDB on OS X



and



Sam Ruby: Building CouchDB



And for you shell script kiddies, I wrote a dead simple update shell that takes care of the above steps. It does steps 4-11 with an svn up.




WHOAMI=`whoami`
export WHOAMI
make clean
svn up
export ERLANG_BIN_DIR=/opt/local/bin
export ERLANG_INCLUDE_DIR=/opt/local/lib/erlang/usr/include/
export UNICODE_INCLUDE_DIR=/opt/local/include
export UNICODE_LIB_DIR=/opt/local/lib
./build.sh | tee build.log
sudo ./build.sh --install=/usr/local | tee install.log
sudo chown -R $WHOAMI:$WHOAMI /usr/local/couchdb/
chmod +x /usr/local/couchdb/bin/couch_erl


Save the above text into a file like mybuild.sh and do a ‘chmod +x mybuild.sh’… Place it in the couchdb directory where you checked out and Voila!

Comments

Leave a response

  1. ShawnSep 18 07 @ 04:34PM

    Looks like fun, but I am unfamiliar with with “tee” command in line #9. The man file says:



    “The tee utility copies standard input to standard output, making a copy in zero or more files. The output is unbuffered.”



    But, couldn’t you just use “>” instead of “| tee”?

  2. Jake GoodSep 18 07 @ 04:34PM

    tee redirects output and then puts it right back to STDOUT.



    tee is also useful when you want to string together outputs… it takes the output, places it into a file and then puts it right back out.



    so you could do something like this:
    cat somefile.txt | tee otherfile.txt > thirdfile.text

  3. ShawnSep 18 07 @ 04:34PM

    That is cool. I love Unix.

  4. Seth LaddOct 22 08 @ 09:16PM
    FYI you can now simply do post install couchdb
  5. Seth LaddOct 22 08 @ 09:17PM
    oops, meant to say you can now simply do:

    port install couchdb

    if you have Mac Ports installed
  6. Jake GoodOct 23 08 @ 08:26AM
    Awesome! That really simplifies things...
Comment