benoitc / couchbeam

Apache CouchDB client in Erlang
Other
242 stars 113 forks source link

using couchbeam in ejabberd module #60

Closed younes200 closed 12 years ago

younes200 commented 12 years ago

Hi, I trying to use couchbeam within a ejabberd module, I use this a sample code :

-module(mod_test).

-define(EJABBERD_DEBUG, true).
-behaviour(gen_mod).

-include("ejabberd.hrl").
-include("couchbeam.hrl").

-export([start/2, stop/1]).

start(Host, _Opts) ->
  ?INFO_MSG("mod_test started ~p",[Host]),

  application:start(sasl),
  application:start(ibrowse),
  application:start(couchbeam),
  CouchDB = couchbeam:server_connection("localhost",5984 ,"",[]),
  {ok, _Version} = couchbeam:server_info(CouchDB),
  ok.

stop(Host) ->
  ?INFO_MSG("mod_test stopping: ~p",[Host]),
  ok.

But, I still getting this error :

=ERROR REPORT==== 2011-10-19 13:21:29 ===
C(<0.34.0>:gen_mod:75) : Problem starting the module mod_test for host "localhost"
 options: []
 error: undef

Also I get all tests successful with 'make test'.

Am I missing something ? Thank you in advance /Y

benoitc commented 12 years ago

are you sure couchbeam is on the path ?

benoitc commented 12 years ago

closing issue since it looks outdated. Feel free to open a new one if needed.