0

I'm using Couchbase 1.8.0 on Mac OS X along with the Ruby libraries to access it. I deleted the default bucket and created by own bucket called 'mybucket', with the password 'password'. I'm accessing the bucket with the following Ruby code:

url = "http://127.0.0.1:8091/pools/default"
Couchbase.new(url, :bucket_name => 'mybucket', :bucket_password => 'password')

and I'm getting the following error:

Couchbase::Error::BucketNotFound (HTTP/1.1 404 Object Not Found
Server: Couchbase Server 1.8.0r_74_g85f643d-community

Does any one have any thoughts? I've tried rebooting both the server and the rails app (even though I shouldn't have to) and it's still not connecting. I'm not really sure what I'm doing wrong.

Thanks!

joelpoloney
  • 419
  • 4
  • 13

1 Answers1

2

So, it looks like the documentation on the Couchbase website was wrong in terms of how to connect with the Ruby library. The correct syntax is below.

bucket = 'mybucket'
password = 'mypassword'
Couchbase.connect("http://localhost:8091/pools/default", :bucket => bucket, :username => bucket, :password => password)

Hope this helps any one with the same problems I had!

joelpoloney
  • 419
  • 4
  • 13
  • Sorry for the trouble there. It's actually a code bug as it should default the username to the bucket name if not supplied. We'll get it fixed. Filed as http://www.couchbase.com/issues/browse/RCBC-47 You can watch it there. (p.s.: I'm from Couchbase) – Matt Ingenthron Jul 08 '12 at 02:13
  • Actually the change was introduced in first 1.x version, to avoid repetition ":bucket_", but as far as you prefer URL-style syntax, you can also use following construction: `Couchbase.connect("http://user:password@localhost:8091/pools/default/buckets/default")` – avsej Jul 09 '12 at 06:40