実行時cargo build
:
error: multiple matching crates for `url`
次に、候補をリストします。
./target/deps/liburl-11a95471847b9e04.rlib
/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/liburl-4e7c5e5c.{so,rlib}
...そして、どちらを決定できないため、中止します。
src/http/lib.rs:18:1: 18:18 error: can't find crate for `url`
src/http/lib.rs:18 extern crate url;
^~~~~~~~~~~~~~~~~
error: aborting due to 2 previous errors
これを回避するには、またはこの問題を修正するにはどうすればよいですか?
ノート:
この問題 とこのコミット は、コメントから問題に関連しているようです:
+//! rust-url’s crate is also named `url`.
+//! Cargo will automatically resolve the name conflict,
+//! but that means that you can not also use the old `url` in the same crate.
インストールの詳細:
$ rustc -v
rustc 0.12.0-pre-nightly (7a25cf3f3 2014-07-30 17:06:18 +0000)
$ cargo -V
0.0.1-pre-nightly (4a69ffa 2014-07-29 21:30:40 +0000)
Cargo.toml
:
[package]
name = "nickel-demo"
version = "0.1.0"
authors = [ "your-name@gmail.com" ]
[[bin]]
name = "nickel-demo"
path = "src/main.rs"
[dependencies.nickel]
git = "https://github.com/nickel-org/nickel.rs.git"
[dependencies.rust-postgres]
git = "https://github.com/sfackler/rust-postgres.git"
( http://nickel.rs/getting-started.htmlからコピーし、依存関係を 1 つ追加)
私が得る完全なエラーはこれです:
Compiling rust-postgres v0.0.0 (https://github.com/sfackler/rust-postgres.git#7d842441)
Build failed, waiting for other jobs to finish...
Could not compile `rust-postgres`.
--- stderr
src/lib.rs:70:1: 70:18 error: multiple matching crates for `url`
src/lib.rs:70 extern crate url;
^~~~~~~~~~~~~~~~~
note: candidates:
note: path: /usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/liburl-4e7c5e5c.so
note: path: /usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/liburl-4e7c5e5c.rlib
note: crate name: url
note: path: /home/bojangle/k/nickel-demo/target/deps/liburl-11a95471847b9e04.rlib
note: crate name: url
src/lib.rs:70:1: 70:18 error: can't find crate for `url`
src/lib.rs:70 extern crate url;
^~~~~~~~~~~~~~~~~
error: aborting due to 2 previous errors
To learn more, run the command again with --verbose.