Don’t forget the port number when replicating CouchDB

In the afternoon I needed to replicate a database  from my co-worker’s CoudhDB using CouchDBX. In the replicator, I entered my co-worker’s database’s path like the following: http://10.0.0.3/TestDatabase And I selected to replicate to one of my existing databases.  Everything seemed to be right (I could ping and telnet my co-worker’s IP and CouchDB port 5984 without problem), but CouchDBX returned error 500, could not connect to remote database. After a series of diagnostics, we finally realized, we forgot to put the port number in the path of remote database. When we changed the database path to http://10.0.0.3:5984/TestDatabase,  everything just worked … Continue reading Don’t forget the port number when replicating CouchDB

Creating a Merb Rack middleware for running in Merb applications

There are a lot of resources on the Internet showing how to write and run a standalone rack application or middleware, but few showing how to write one to run in other Merb applications. This is actually very easy, so I’m going to share how I did it. Hopefully to be helpful to people in such need. The goal is to have a rack middleware in a merb application, which can be installed as gem, and then can be ued in other merb applications. First, create the merb application: $ merb-gen app application_name where application_name is your proposed application name. … Continue reading Creating a Merb Rack middleware for running in Merb applications