Giter VIP home page Giter VIP logo

Comments (6)

comtihon avatar comtihon commented on September 13, 2024

erl -pa ebin/ deps/bson/ebin/

  Erlang/OTP 17 [erts-6.4] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false]

  Eshell V6.4  (abort with ^G)
  1> application:start(bson).
  ok
  2> application:start(crypto).                                                                                                       
  ok                                                                                                                                  
  3>  application:start(mongodb).                                                                                                     
  ok                                                                                                                                  
  4> mongo:connect(<<"test">>).                                                                                                       
  {ok,<0.45.0>}

Everything seems to be working.
Did you run make in mongodb-erlang directory?
In the last (tooday commit) version crypto application and one more dependency (pbkdf2) were added. But their lack should not rise exception as you post.

from mongodb-erlang.

Elexy avatar Elexy commented on September 13, 2024

I tried the exact steps again and the result is the same. I'm running it with erleng R15B01 and you run 17. Could that be the issue?

[edit] i tried with 17.5, the latest in kerl, and no success. I pasted the output below, the last lines are result of trying autocomplete with tab. mongo isn't recognised....

erl -pa ebin/ deps/bson/ebin/
Erlang/OTP 17 [erts-6.4] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]

Eshell V6.4  (abort with ^G)
1> application:start(bson).
ok
2> application:start(crypto).
ok
3> application:start(mongodb).
ok
4> mongo_
mongo_app          mongo_id_server    
4> mongo_
mongo_app          mongo_id_server    
4> mongo_

also after removing the mongo-erlang dir and starting from scratch:

git clone git://github.com/mongodb/mongodb-erlang.git
Cloning into 'mongodb-erlang'...
remote: Counting objects: 935, done.
remote: Total 935 (delta 0), reused 0 (delta 0), pack-reused 935
Receiving objects: 100% (935/935), 301.88 KiB | 201 KiB/s, done.
Resolving deltas: 100% (499/499), done.
alex@ElementaryElexy~/dev/erlang $  cd mongodb-erlang/
alex@ElementaryElexy~/dev/erlang/mongodb-erlang $  make
WARN:  Expected /home/alex/dev/erlang/mongodb-erlang/deps/bson to be an app dir (containing ebin/*.app), but no .app found.
==> mongodb-erlang (get-deps)
WARN:  Expected /home/alex/dev/erlang/mongodb-erlang/deps/bson to be an app dir (containing ebin/*.app), but no .app found.
Pulling bson from {git,"git://github.com/soundrop/bson-erlang","HEAD"}
Cloning into 'bson'...
==> bson (get-deps)
==> bson (compile)
Compiled src/bson_schema.erl
/home/alex/dev/erlang/mongodb-erlang/deps/bson/src/bson.erl:168: Warning: Non-UTF-8 character(s) detected, but no encoding declared. Encode the file in UTF-8 or add "%% coding: latin-1" at the beginning of the file. Retrying with latin-1 encoding.
Compiled src/bson.erl
Compiled src/bson_binary.erl
==> mongodb-erlang (compile)
Compiled src/main/mongo_app.erl
Compiled src/main/mc_super_sup.erl
Compiled src/connection/mc_worker_logic.erl
Compiled src/api/mongo.erl
Compiled src/connection/mc_connection_man.erl
Compiled src/connection/mc_worker.erl
Compiled src/cursor/mc_cursor_sup.erl
Compiled src/core/mc_action_man.erl
Compiled src/core/mongo_id_server.erl
Compiled src/cursor/mc_cursor.erl
Compiled src/core/mongo_protocol.erl
alex@ElementaryElexy~/dev/erlang/mongodb-erlang $  erl -pa ebin deps/bson/ebin
Erlang/OTP 17 [erts-6.4] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]

Eshell V6.4  (abort with ^G)
1> application:start
start/1       start/2       start_boot/1  start_boot/2  start_type/0  

1> application:start(bson).
ok
2> application:start(mongodb).
ok
3> mongo_ <-- pressed TAB here 
mongo_app          mongo_id_server    
3> mongo_

from mongodb-erlang.

comtihon avatar comtihon commented on September 13, 2024

ok, I see. You clone wrong repo.
git://github.com/mongodb/mongodb-erlang.git is old one, not supported.
Use https://github.com/comtihon/mongodb-erlang.git
It is former mongodb's repo, transfered to me (you can see it on mongodb-drivers official page).
Also I advice you to switch to newer erlang, as this driver may not support <16 version.

from mongodb-erlang.

Elexy avatar Elexy commented on September 13, 2024

Yeah, that was it! Thanks.

I made a PR to correct the readme ;-)
#66

from mongodb-erlang.

bskoztrk avatar bskoztrk commented on September 13, 2024

how to fix this?
sudo ejabberdctl debug

Erlang R16B03 (erts-5.10.4) [source] [64-bit] [async-threads:10] [kernel-poll:true]

Eshell V5.10.4 (abort with ^G)
(ejabberd@localhost)1> Database = <<"test">>.
<<"test">>
(ejabberd@localhost)2> {ok, Connection} = mongo:connect (Database).
** exception error: undefined function mongo:connect/1

from mongodb-erlang.

comtihon avatar comtihon commented on September 13, 2024

Please, check if mongo:connect:1 exists in repo you cloned. May be you cloned wrong repo, as above.
Also check, if source server can load mongo module - may be mondodb-erlang/ebin is not included.
Finally - check if you built mongodb-erlang.

from mongodb-erlang.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.