- An introduction to CouchDB
- Installing CouchDB
- Experimenting with CouchDB’s web interface
- Integrating with Rails using ActiveCouch
- Integrating with Rails using RelaxDB
- Getting to scaffolding using RelaxDB
- Installing CouchDB from Subversion source code
- Trying out couchrest and topfunky’s basic_model
It occurs to me that before i can get Rails working with CouchDB it would be a good idea to actually install CouchDB! I’m going to try the download rather than the SVN source code because i’m clueless with SVN. So here goes. I am downloading version 0.8.1.
Edit to add: If you want to install from Subversion, see my later tutorial in Part 7: Installing CouchDB from Subversion source code
Ah, the README tells me i need Erlang and a few other things. Since i use Debian i can apt-get some packages. (Have i ever said how much i love Debian?!)
sudo apt-get install build-essential erlang libicu36 libicu36-dev libmozjs-dev
That was easy! Now on with the CouchDB install.
./configure make sudo make install
Awesome! All done!
I like to clean up temporary files afterwards. It’s a virgo thing.
make clean make distclean
Do i really need to make a new user and group just to run CouchDB? Can’t the owner just be me? Oh well, at this stage in the game i’m going to do as i’m told, but this seems a bit odd to me.
su adduser --system --home /var/lib/couchdb --no-create-home --shell /bin/bash --group --gecos "CouchDB Administrator" couchdb chown -R couchdb /usr/local/var/lib/couchdb/ chown -R couchdb /usr/local/var/log/couchdb/ exit
Okay, so the couchdb user owns the directories that make CouchDB work. So apparently i can use sudo to impersonate the couchdb user and run the command ‘couchdb’.
sudo -i -u couchdb couchdb
Well apart from a little error, that seems to have worked.
So now i can apparently go to http://localhost:5984/_utils/index.html and see something …
Nice! And apparently there are some test specs i can run … ah yes, the link is there on the right …
Awesomeness abounds!! All the tests passed!
The server console tells us what is happening as it runs the tests:
I see some RESTful calls to POST, GET, PUT and DELETE there, and some responses: 200 for OK, 201 for Created, and 202 for Accepted. That is neat!
In the next part i will experiment and see what i can do with CouchDB via the web interface. For now, i’ll go to bed happy that i got it installed and running. That was a very easy and satisfying install. :)
Wow. Really happy to see that you had such an easy time installing CouchDB!
I’m looking forward to reading the rest of your CouchDB series. If you have any trouble with CouchDB please do step into the #couchdb IRC channel on freenode. We’re there most of the time, tending toward the US morning, as a lot of the participants are on European time.
I hope you have as much success getting to hello world on your first application as you did with installation!
Hi Chris, thank you!
You know what? In all my 28 years of existing, i have never once been in an IRC. Maybe it’s time to confront my fear and give it a try!
@Aimee, Twitter is enough of a time-sink if you are sensitive to that ;) But welcome on IRC, if you like. Also, keep it up, this series looks very promising already.
Thanks Jan, i am encouraged by your approval :)
Part three and four today then? :D
Haha, wait and see …!
Thanks Aimee! I’m starting tou get encouraged to try CouchDB by reading your articles :)
Can’t wait for the next parts!
Woohoo! I am pleased to hear that! :)
Hey Aimee, glad you found the install instructions easy to follow.
Sorry about the little problem when you start up CouchDB, that’s actually a bug with the documentation that I fixed this week.
To correct the problem on your system, open the /etc/passwd file as root and find the line corresponding to the CouchDB user and replace /var/lib/couchdb with /usr/local/var/lib/couchdb
Aha, great, i thought there would be an easy fix for it. It’s not a problem anyway; the service still runs just fine. Thanks for the clarification.
Your blog helped clear up why i couldn't start up couchdb bon osx…..the apache site is useless at giving CRUCIAL information like that.
thanks for these detailed and visual instructions
I you are using debian (squeeze, at least) you can also:
sudo apt-get install couchdb
And you get it up and running.
Thanks for the series, I keep reading.
this is another resource that I found helpful that describes couchdb and lucene set up: http://bit-rattle.blogspot.com/2009/07/time-to-…
I'm looking forward to reading the rest of your CouchDB series. If you have any trouble with CouchDB please do step into the #couchdb IRC channel on freenode. We're there most of the time, tending toward the US morning, as a lot of the participants are on European time.