Open jtjenkins opened 10 years ago
I was able to connect with a a config file in config/couchbase.yml and a single ruby file no problem.
What do you mean here, you wrote your own function which loads config from YAML file? Because automatically it gets loaded only in rails environment using railtie. https://github.com/couchbase/couchbase-ruby-model/blob/master/lib/couchbase/railtie.rb#L64-L94
Could try to add this lines to your configure
hook?
filename = "config/couchbase.yml"
config = YAML.load(ERB.new(File.read(filename)).result)[environment]
::Couchbase.connection_options = config
I'm trying to do a Sinatra API around Couchbase. I was able to connect with a a config file in config/couchbase.yml and a single ruby file no problem.
Now that I'm trying to wrap it in Sinatra, I'm using the same config file, and the same model definition (now in a separate file that's being pulled in)
Now it's telling me it can't find the bucket, which doesn't make sense since I'm able to connect without Sinatra.
I'm not using any local views yet, I'm just testing the writing.
Is there any way to figure out where it's unable to connect?
Controller I'm using to test with:
Model Declaration:
Config file (config/couchbase.yml)
Stack Trace: