benoitc / couchbeam

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

rebar generate error #106

Closed stofel closed 10 years ago

stofel commented 10 years ago

rebar compile generate give error: ==> rel (generate) ERROR: Unable to generate spec: Undefined applications: [ets_lru] *\ [install] Error code 1

Few days ago its worked correctly.

benoitc commented 10 years ago

You need to do a rebar update-deps then rebar get-deps to get the latest updated version of hackney. ets_lru is used to cache IDNA domains encoding.

Let me know if it works for you.

stofel commented 10 years ago

Oh, I get it work. Its need to add {app, ets_lru, [{incl_cond, include}]} in reltool.config file. Thanks for your answer!

benoitc commented 10 years ago

On Tue, Mar 11, 2014 at 12:17 PM, stofel notifications@github.com wrote:

Oh, I get it work. Its need to add {app, ets_lru, [{incl_cond, include}]} in reltool.config file. Thanks for your answer!

That's a good point! I will document it, thanks for the feedback :)

  • benoit
stofel commented 10 years ago

Here is more changes.., pls_couchdb_test:test_load(). \ exception error: undefined function xmerl_ucs:from_utf8/1 in function idna:utf8_to_ascii/1 (src/idna.erl, line 34) in call from hackney_connect:connect/5 (src/hackney_connect.erl, line 30) in call from hackney:request/5 (src/hackney.erl, line 281) in call from couchbeam:open_or_create_db/4 (src/couchbeam.erl, line 384) in call from pls_couchdb_test:test_load/0 (src/pls_couchdb_test.erl, line 55)

I make some report, when get all working.

benoitc commented 10 years ago

do you have erlang-xmerl installed or suff like this?

On Tue, Mar 11, 2014 at 12:26 PM, stofel notifications@github.com wrote:

Here is more changes.., pls_couchdb_test:test_load(). \ exception error: undefined function xmerl_ucs:from_utf8/1 in function idna:utf8_to_ascii/1 (src/idna.erl, line 34) in call from hackney_connect:connect/5 (src/hackney_connect.erl, line 30) in call from hackney:request/5 (src/hackney.erl, line 281) in call from couchbeam:open_or_create_db/4 (src/couchbeam.erl, line 384) in call from pls_couchdb_test:test_load/0 (src/pls_couchdb_test.erl, line 55)

I make some report, when get all working.

Reply to this email directly or view it on GitHubhttps://github.com/benoitc/couchbeam/issues/106#issuecomment-37285594 .

stofel commented 10 years ago

I have installed rabbitmq server, and it install libs which cross many my libs, so i have to: {incl_cond, exclude} in reltools.config and add like {app, xmerl, [{incl_cond, include}]} for each lib. For ets_lru it was uncleanly because of different error message. So to generate and get work need to add ,{app, ets_lru, [{incl_cond, include}]} ,{app, idna, [{incl_cond, include}]} ,{app, xmerl, [{incl_cond, include}]} to reltools.config

Can i ask you one more question? I should prepare docs for save in couch in format {doc} or {proplist}, as it is in jiffy encoder. But jsx encode json in proplists without {}. Is any way to make couchbeam:save_doc and couchbeam:open_doc in jsx like format?

Sorry for asking here, and thanks for answers.

benoitc commented 10 years ago

If you set couchbeam to use jsx it won't change anything. In couchbeam the jsx encode and decode functions have been set to behave like jiffy:

https://github.com/benoitc/couchbeam/blob/master/src/couchbeam_ejson.erl#L44

So using jiffy or jsx don't change anything except the stability and performance (jsx can never block the vm but is slower). If you want to easily retrieve the values you can use the couchbean_doc functions .

On Tue, Mar 11, 2014 at 12:41 PM, stofel notifications@github.com wrote:

I have installed rabbitmq server, and it install libs which cross many my libs, so i have to: {incl_cond, exclude} in reltools.config and add like {app, xmerl, [{incl_cond, include}]} for each lib. For ets_lru it was uncleanly because of different error message.

Can i ask you one more question? I should prepare docs for save in couch in format {doc} or {proplist}, as it is in jiffy encoder. But jsx encode json in proplists without {}. Is any way to make couchbeam:save_doc and couchbeam:open_doc in jsx like format?

Sorry for asking here, and thanks for answers.

Reply to this email directly or view it on GitHubhttps://github.com/benoitc/couchbeam/issues/106#issuecomment-37286634 .

stofel commented 10 years ago

Ok.. Its large project with deep jsx encoded data structures. It would be great to have option to switch this behave. I`Il try to make this and if will result send the patch.

benoitc commented 10 years ago

On Tue, Mar 11, 2014 at 1:06 PM, stofel notifications@github.com wrote:

Ok.. Its large project with deep jsx encoded data structures. It would be great to make options to switch this behave. I`Il try to make this and if will result send the patch.

That should be possible, the modules that need to be patched are couchbeam_doc, couchbeam_ejson and couchbeam_doc.

There are some bits in other modules that expect to receive {[...]} that also need to be fixed, but so far this is a 5 days work.

Reply to this email directly or view it on GitHubhttps://github.com/benoitc/couchbeam/issues/106#issuecomment-37288318 .

stofel commented 10 years ago

I modified code and.. This is completely broke jiffy support :(. I don`t known what to do, write my own converter, and loose some performance, or make patch and support it. It is so bad that have such difference between jsx and jiffy.