2night / mondo

D library for MongoDb (over mongo-c-library)
MIT License
22 stars 8 forks source link

Mondo not working in dub. #1

Closed trezker closed 8 years ago

trezker commented 8 years ago

I just made a dub project and added mondo as dependency. "dependencies": { "mondo": ">=1.1.3" }

Dub gives this error on first run. no package file was found, expected one of the following: [immutable(FilenameAndFormat)("dub.json", json), immutable(FilenameAndFormat)("package.json", json)]

And this on the second run, the package gets downloaded but dub can't use it. mondo (1.1.3) needs to be removed from '/home/anders/.dub/packages/mondo-1.1.3' prior placement.

trikko commented 8 years ago

I guess you have a old version of dub. Probably you need to update it. It search for dub.json but now default format is sdl.

This works for me:

andrea@ububocs:/tmp$ dub init test
Successfully created an empty project in '/tmp/test'.
andrea@ububocs:/tmp$ cd test/
andrea@ububocs:/tmp/test$ cat dub.sdl 
name "test"
description "A minimal D application."
copyright "Copyright © 2016, andrea"
authors "andrea"
andrea@ububocs:/tmp/test$ echo 'dependency "mondo" version="1.1.3"' >> dub.sdl
andrea@ububocs:/tmp/test$ cat dub.sdl
name "test"
description "A minimal D application."
copyright "Copyright © 2016, andrea"
authors "andrea"
dependency "mondo" version="1.1.3"
andrea@ububocs:/tmp/test$ echo 'import mondo;' >> source/app.d 
andrea@ububocs:/tmp/test$ dub
Performing "debug" build using dmd for x86_64.
mondo 1.1.3: target for configuration "library" is up to date.
test ~master: building configuration "application"...
Linking...
To force a rebuild of up-to-date targets, run again with --force.
Running ./test 
Edit source/app.d to start your project.
andrea@ububocs:/tmp/test$ 
trikko commented 8 years ago

Whoops accidentaly closed

trezker commented 8 years ago

Indeed, I was one little version number behind. Then I needed to find libmongo. I couldn't find any deb package for that but building from source worked at least. The issue is solved as far as I'm concerned.

trikko commented 8 years ago

It's quite easy to compile. You just need to checkout mongo-c-driver repository (with submodules) and run

$ curl -LO https://github.com/mongodb/mongo-c-driver/releases/download/1.3.4/mongo-c-driver-1.3.4.tar.gz
$ tar xzf mongo-c-driver-1.3.4.tar.gz
$ cd mongo-c-driver-1.3.4/
$ ./configure --with-libbson=bundled
$ make 
$ sudo make install

It takes just a minute or two. That's all

adilbaig commented 8 years ago

@trikko May i suggest making the above part of the installation instructions in the README.

trikko commented 8 years ago

Suggestion accepted!