Beer Sample + Rails + Remote database servers

More infos:
When I set @default_options[:couchbase][:hostname] manually in rack/session.rb it works.
So it seems the example is not grabbing anything from the config/couchbase.yml file?

Switched my install from Ubuntu 12.04 to 10.04, since 12.04 wasn’t super supported yet. Getting this error now:

couchbase.rb:58: [BUG] Segmentation fault
ruby 1.9.3p374 (2013-01-15 revision 38858) [i686-linux]

Trying the 1.2.1 gem give me the same as well…

Hey Guys,
When running rails server, I keep getting a

couchbase.rb:58:in `initialize’: Connection failed: Connection refused (error=0x18) (Couchbase::Error::Connect)

with the following config:

common: &common
hostname: 192.168.166.101
port: 8091
username:
password:
pool: default

development:
<<: *common
bucket: beer-sample

production:
<<: *common
bucket: beer-sample

When I connect through IRB, it works:

irb(main):004:0> c = Couchbase.connect(“http://192.168.166.101:8091/pools/default”)
=> #<Couchbase::Bucket:0x915efc4 “http://192.168.166.101:8091/pools/default/buckets/default/” default_format=:document, default_flags=0x0, quiet=false, connected=true, timeout=2500000>

Anything I am missing?

if we can’t solve it easily through just figuring out any version mismatches, I’ll try to spin up an ubuntu 10.04 vm… reply to the thread if the problem is still happening…

Could you please post libcouchbase version and ruby gem version here?

Still happens!
ruby-1.9.3-p374
rails 3.2.8
ubuntu server 12.04

could you post output of the following commands?
$ apt-cache show libcouchbase2-core
and
$ gem list couchbase

The message in the couchbase log is logged twice with 30-60 seconds between each. Ordinarily Id put an entry in the hosts file, but I want to avoid doing this for obvious reasons.Services

apt-cache show libcouchbase2-core

Package: libcouchbase2-core
Source: libcouchbase
Version: 2.0.3-443
Architecture: i386
Maintainer: Couchbase SDK Team support@couchbase.com
Installed-Size: 184
Depends: libc6 (>= 2.7)
Homepage: http://www.couchbase.com/develop/c/current

Priority:
optional
Section: libs
Filename: pool/lucid/main/libc/libcouchbase/libcouchbase2-core_2.0.3-443_i386.deb
Size: 70138
SHA256: 5f80a62191855fb01e800c8c97387e357088a3313a21748e79d8c327dcff151b
SHA1: acbda8a5796ab16f99b85175860889d091246c02
MD5sum: 0ec070bb1945bbe4ad27f9a25d9c64b5
Description: library for the Couchbase protocol, core files
libcouchbase is a library implementing Couchbase protocol.
.
This package provides the Couchbase client library but without any IO backend.

Package: libcouchbase2-core
Status: install ok installed
Priority: optional
Section: libs
Installed-Size: 168
Maintainer: Couchbase SDK Team support@couchbase.com
Architecture: i386
Source: libcouchbase
Version: 2.0.2-416
Depends: libc6 (>= 2.7)
Description: library for the Couchbase protocol, core files
libcouchbase is a library implementing Couchbase protocol.
.
This package provides the Couchbase client library but without any IO backend.
Homepage: http://www.couchbase.com/develop/c/current
*** LOCAL GEMS ***

couchbase (1.2.1, 1.2.0, 1.2.0.z.beta5)
couchbase-model (0.5.1)

As you can see, i’ve tried a few different gem versions; but all with the same result. My feeling is that the config somehow doesn’t get picked up and falls back to localhost.

You are correct, the session and cache stores doesn’t use connection options from confing/couchbase.yml

libcouchbase 2.0.4 hasn’t released yet, but you can try to use “snapshot” repository, where we are uploading the most recent version which passed tests, just switch your repo to this one
deb http://packages.couchbase.com/snapshot/ubuntu precise precise/main

The issue has been fixed in libcouchbase (CCBC-180) https://github.com/couchbase/libcouchbase/commit/aadb912dc8d69bcf67805ad