Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.ruby > #4164 > unrolled thread

Need some starter help with CouchPotato

Started byOren Shani <orenshani7@gmail.com>
First post2011-05-09 11:02 -0500
Last post2011-05-13 08:46 -0500
Articles 4 — 3 participants

Back to article view | Back to comp.lang.ruby


Contents

  Need some starter help with CouchPotato Oren Shani <orenshani7@gmail.com> - 2011-05-09 11:02 -0500
    Re: Need some starter help with CouchPotato 7stud -- <bbxx789_05ss@yahoo.com> - 2011-05-09 14:22 -0500
    Re: Need some starter help with CouchPotato Brian Candler <b.candler@pobox.com> - 2011-05-10 02:18 -0500
    Re: Need some starter help with CouchPotato Oren Shani <orenshani7@gmail.com> - 2011-05-13 08:46 -0500

#4164 — Need some starter help with CouchPotato

FromOren Shani <orenshani7@gmail.com>
Date2011-05-09 11:02 -0500
SubjectNeed some starter help with CouchPotato
Message-ID<57470d14b061b2ee24015340c790991c@ruby-forum.com>
Hi All,

I am trying to use CouchPotato with a CouchDB instance on CloudAnt.

Following the very little documentation I could find, I am trying to do
this:

require "rubygems"
gem "couch_potato"
require "couch_potato"
CouchPotato::Config.database_name = "hangman"
CouchPotato::Config.database_server =
"https://user:password@orenshani.cloudant.com:5984"
CouchPotato.database

But I get an error

NoMethodError: undefined method `database_server=' for
#<#<Class:0xb73db280>:0xb73db0c8>
  from ./couch.rb:5
  from (irb):1:in `require'
  from (irb):1
  from /usr/lib/ruby/1.8/rubygems.rb:123


I checked with CouchPotato::Config.methods and database_server is really
not there

I am using CouchDB version 0.5.4

I'd appreciate it if anyone could tell me how to correctly connect to
the server. I can also be talked into other ways for using CouchDB as a
persistence layer...

Many thanks

Oren Shani

-- 
Posted via http://www.ruby-forum.com/.

[toc] | [next] | [standalone]


#4170

From7stud -- <bbxx789_05ss@yahoo.com>
Date2011-05-09 14:22 -0500
Message-ID<0807812a42fd7c855bfa69c38a86d3a7@ruby-forum.com>
In reply to#4164
Oren Shani wrote in post #997581:
>
> CouchPotato::Config.database_name = "hangman"
> CouchPotato::Config.database_server =
> "https://user:password@orenshani.cloudant.com:5984"
>

According to the README.md file here:

https://github.com/langalex/couch_potato/blob/master/README.md

..you are supposed to use the database_name=() method to set the url:

CouchPotato::Config.database_name = 
"http://username:password@example.com:5984/name_of_the_db"

-- 
Posted via http://www.ruby-forum.com/.

[toc] | [prev] | [next] | [standalone]


#4186

FromBrian Candler <b.candler@pobox.com>
Date2011-05-10 02:18 -0500
Message-ID<457ad97defbaf28cd8879a3e928e2f79@ruby-forum.com>
In reply to#4164
Oren Shani wrote in post #997581:
> But I get an error
>
> NoMethodError: undefined method `database_server=' for
> #<#<Class:0xb73db280>:0xb73db0c8>
>   from ./couch.rb:5
>   from (irb):1:in `require'
>   from (irb):1
>   from /usr/lib/ruby/1.8/rubygems.rb:123

One trap which might catch you out - if the library itself has a file 
called "couch.rb" then calling your own program "couch.rb" will prevent 
'require' from loading it.

To eliminate that as a possible problem, just rename your couch.rb to 
something else.

> I checked with CouchPotato::Config.methods and database_server is really
> not there

Oh well, then calling it isn't going to work :-) You'll need to dig 
through the docs or find some sample apps which use CouchPotato.

Incidentally, I made a completely separate CouchDB API called 
"couchtiny", although I'm not using or developing it at the moment. It's 
on github, and you're more than welcome to try it out. It has some usage 
examples in the README and in the doc/ subdir.

-- 
Posted via http://www.ruby-forum.com/.

[toc] | [prev] | [next] | [standalone]


#4488

FromOren Shani <orenshani7@gmail.com>
Date2011-05-13 08:46 -0500
Message-ID<375256d5ae50f797effe04591dfe1886@ruby-forum.com>
In reply to#4164
Thank you both for your answeres. Specifying the database URL to 
database_name seem to work.

Candierb, I will look at your couchtiny and try to use it instead of 
Couch Potato. Quite frankly, I'm just looking for a simple way to save 
and load ruby objects with CouchDB, so whatever works...

Best,

Oren

-- 
Posted via http://www.ruby-forum.com/.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.ruby


csiph-web