Jaron Bradley
Jaron Bradley

Reputation: 1119

Can't create MongoClient.new

I don't know what the deal is with this. Everything works fine until i try to create a new MongoClient

irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> require 'mongo'
=> true
irb(main):003:0> include Mongo
=> Object
irb(main):004:0> client = MongoClient.new('127.0.0.1', 27017)
NameError: uninitialized constant MongoClient
        from (irb):4
        from :0
irb(main):005:0>

Upvotes: 5

Views: 4794

Answers (1)

iltempo
iltempo

Reputation: 16012

You are using an older version (1.5.2) of the mongo gem instead of the most current one (1.8.0). That days the connection has been made by

conn = Mongo::Connection.new

Find out more in the documentation of version 1.5.2

Upvotes: 7

Related Questions