Alexandr T Alexandr T - 1 year ago 82
Ruby Question

Ruby: connect to Couchbase

I want to connect to Couchbase DB server trough couchbase gem.

require 'couchbase'
c = Couchbase.connect('http://<server>:<port>/pools/default/buckets/auth')

I get an error:

*** Couchbase::Error::BucketNotFound Exception: bootstrap error, The bucket requested does not exist

The following code works with the (couchbase python package):

from couchbase.bucket import Bucket
c = Bucket('couchbase://<server>/auth')

How I can connect from ruby by using connection string

Answer Source

Need specify bucket if it is custom:

Couchbase.connect("http://<server>:8091/pools/default", :bucket => 'auth')
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download