[ Launch: Tributary inlet ] 5351259 by scalabl3
So in order to make this work for Ruby, I have to add something in my wrapper around Couchbase Ruby gem (I do have a wrapper I made/use, need to modify it), to handle the Couchbase::Error::Network on pretty much every operation to be able to reconnect, since currently that is not automatic.
#<Couchbase::Bucket:0x007fcb1411d780 "http://localhost:8091/pools/default/buckets/test/" default_format=:document, default_flags=0x0, quiet=false, connected=true, timeout=2500000>
2013-03-22 09:54:59.109 INCR curr = 1, counter = 1; connected = true, sleeping for 1s
2013-03-22 09:55:00.109 wake
2013-03-22 09:55:00.109 INCR curr = 2, counter = 2; connected = true, sleeping for 2s
2013-03-22 09:55:02.110 wake
Order of Operations
- Handle post Mountain Lion upgrade if you had Homebrew
- Install/Upgrade Couchbase Server
- Install Homebrew (if you don't have it already)
- Install latest XCode
- Install XCode Command Line Tools
- Install libcouchbase C library
#$ gem install couchbase --pre#
...
/Users/jasdeep/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /Users/jasdeep/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:491:in `block in try_compile'
from /Users/jasdeep/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:443:in `with_werror'
from /Users/jasdeep/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:491:in `try_compile'
from extconf.rb:89:in `'
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
deployment: null, | |
management-major-version: 1, | |
management-minor-version: 2, | |
name: "jumbojet", | |
namespaces: [ ], | |
product-name: null, | |
product-version: null, | |
profile-name: null, | |
release-codename: "Steropes", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# This is an RVM Project .rvmrc file, used to automatically load the ruby | |
# development environment upon cd'ing into the directory | |
# First we specify our desired <ruby>[@<gemset>], the @gemset name is optional. | |
environment_id="jruby-1.7.0.preview2@torquebox" | |
# | |
# First we attempt to load the desired environment directly from the environment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/Users/jasdeep/rvm/rubies/ruby-1.9.3-p125/bin/ruby extconf.rb | |
checking for libcouchbase_getl() in -lcouchbase... yes | |
checking for mach/mach_time.h... yes | |
checking for stdint.h... yes | |
checking for sys/time.h... yes | |
checking for clock_gettime()... no | |
checking for gettimeofday()... yes | |
checking for QueryPerformanceCounter()... no | |
creating couchbase_config.h | |
creating Makefile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Hash | |
# if key doesn't exist, returns false | |
# if self[key] == false, returns false | |
# if self[key] == nil, empty, or blank, returns false | |
# if self[key] exists and self[key] == true, or evaluates to true, returns true | |
def has_key_and_value? (key) | |
return false unless has_key?(key) | |
return false if self[key].nil? | |
return false if self[key].respond_to?(:empty?) && self[key].empty? |