CouchDB on Rails (part 2 of ?)
- 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. :)
Part 3: Experimenting with CouchDB's web interface
Related posts (automatically calculated)


