Rails + oauth-plugin + mongodb – Part 1: Provider

Recently I had a chance to work with Oauth and Rails using oauth-plugin and mongodb. Although oauth-plugin itself has a documentation but actually doesn’t cover the mongoid part detailed enough. Also I found this very good tutorial but it’s for SQLite3 only: Oauth Provider, Oauth Consumer

Base on the above posts, to get Rails and oauth-plugin working with mongodb, you need to do some changes.

Firstly, create a oauth-sample directory, you’ll put provider and consumer apps in there.

Read More »

Install MongoDB on Snow Leopard

I have to install MongoDB on a Linode server with Ubuntu 10.04. So I decided to install it on my MBP first. It’s a cool little database, and John Nunemaker’s MongoMapper gem is a treat.

Here’s how I got the server installed and running as a daemon in Snow Leopard for local development.

Download, unpack, and install the pre-compiled 32-bit binaries:

curl -O http://downloads.mongodb.org/osx/mongodb-osx-i386-1.4.0.tgz
tar xzf mongodb-osx-i386-1.4.0.tgz
sudo mv mongodb-osx-i386-1.4.0 /usr/local/mongodb
sudo mkdir /usr/local/mongodb_data /var/log/mongodb
sudo chown -R root /usr/local/mongodb

(If you’re on a 64-bit machine, substitute in x86_64 for each i386 above.)

Read More »