I have installed mongo and bson_ext now I have created a .rb file with the following contents ::
require \'rubygems\' require \'mongo\' db = Mongo::Connecti
This is definitely due to your mongo server not running. Since you're on Ubuntu, try doing a sudo /etc/init.d/mongodb start and then see if your code works.
sudo /etc/init.d/mongodb start