diesel: Could not compile diesel_cli
Setup
Versions
- Rust: rustc 1.33.0 (2aa4c46cf 2019-02-28)
- Database: postgres
- Operating System Ubuntu 18.04.1 LTS
Feature Flags
- diesel: postgres
Problem Description
Unable to install diesel_cli
What is the actual output?
cargo install diesel_cli --no-default-features --features postgres
Updating crates.io index
Installing diesel_cli v1.4.0
Compiling proc-macro2 v0.4.27
Compiling cc v1.0.32
Compiling libc v0.2.51
Compiling unicode-xid v0.1.0
Compiling memchr v2.2.0
Compiling syn v0.15.29
Compiling autocfg v0.1.2
Compiling byteorder v1.3.1
Compiling unicode-xid v0.0.4
Compiling rand_core v0.4.0
Compiling num-traits v0.2.6
Compiling pq-sys v0.4.6
Compiling num-integer v0.1.39
Compiling serde v1.0.89
Compiling regex v0.2.11
Compiling smallvec v0.6.9
Compiling lazy_static v1.3.0
Compiling rustc-demangle v0.1.13
Compiling cfg-if v0.1.7
Compiling ucd-util v0.1.3
Compiling matches v0.1.8
Compiling quote v0.3.15
Compiling bitflags v1.0.4
Compiling unicode-width v0.1.5
Compiling utf8-ranges v1.0.2
Compiling ansi_term v0.11.0
Compiling percent-encoding v1.0.1
Compiling vec_map v0.8.1
Compiling remove_dir_all v0.5.1
Compiling strsim v0.7.0
Compiling backtrace-sys v0.1.28
Compiling backtrace v0.3.14
Compiling rand_chacha v0.1.1
Compiling rand_pcg v0.1.2
Compiling rand v0.6.5
Compiling synom v0.11.3
Compiling rand_core v0.3.1
Compiling rand_jitter v0.1.3
Compiling unicode-normalization v0.1.8
Compiling thread_local v0.3.6
Compiling regex-syntax v0.5.6
Compiling unicode-bidi v0.3.4
Compiling textwrap v0.10.0
Compiling syn v0.11.11
Compiling rand_xorshift v0.1.1
Compiling rand_isaac v0.1.1
Compiling rand_hc v0.1.0
Compiling idna v0.1.5
Compiling quote v0.6.11
Compiling rand_os v0.1.3
Compiling atty v0.2.11
Compiling time v0.1.42
Compiling aho-corasick v0.6.10
Compiling derive-error-chain v0.10.1
error: failed to compile `diesel_cli v1.4.0`, intermediate artifacts can be found at `/tmp/cargo-installAh6AoH`
Caused by:
Could not compile `derive-error-chain`.
Caused by:
process didn't exit successfully: `rustc --crate-name derive_error_chain /home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/derive-error-chain-0.10.1/src/lib.rs --color always --crate-type proc-macro --emit=dep-info,link -C prefer-dynamic -C opt-level=3 -C metadata=0f314aedb4e0a6c9 -C extra-filename=-0f314aedb4e0a6c9 --out-dir /tmp/cargo-installAh6AoH/release/deps -L dependency=/tmp/cargo-installAh6AoH/release/deps --extern quote=/tmp/cargo-installAh6AoH/release/deps/libquote-6c11d4fe1d50bb75.rlib --extern syn=/tmp/cargo-installAh6AoH/release/deps/libsyn-cf3b6b9bbadaa925.rlib --cap-lints allow` (signal: 9, SIGKILL: kill)
Checklist
- I have already looked over the issue tracker for similar issues.
- This issue can be reproduced on Rust’s stable channel. (Your issue will be closed if this is not the case)
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 35 (9 by maintainers)
i install
and it works. Thanks Guys!
For Googlers;
You should build for your database, like:
And make sure these are installed on your system.
I have different logs for installing:
@IamSaquib
If you are on
ubuntu, try:Had the same issue today. I use arch/manjaro. I installed
libmariadbclient postgresql-libs sqlite@ramsayleung answer helped me! Here are the steps followed to successfully install the cli app
Check a file was made
Setup file as swap
Check that it worked
Lastly setup swap to work on boot
Now install Diesel!
woooo profit
I had to install the proper things and then run a more specific CLI bundle.
First I had to install mysql-server and get it set up. Then:
sudo apt install libpq-dev libmysqlclient-devcargo install diesel_cli --no-default-features --features postgresI have the same error on my VPS with 521M RAM when compiling diesel_cli, and I am sure I have installed libpq-dev and other dependencies. After suffering for a few days, I fix this error with creating a 2G swapfile to alleviate some of pressure on RAM, and diesel_cli works perfectly now.
I am creating CRUD for using sqlite When i did
cargo install diesel_cli --no-default-features --features sqliteI got this error`note: /usr/bin/ld: cannot find -lsqlite3 collect2: error: ld returned 1 exit status
error: aborting due to previous error
error: failed to compile
diesel_cli v1.4.0, intermediate artifacts can be found at/tmp/cargo-installoNhOKuHow to link library for sqlite? I have sqlite3 installed in my system
@paulocsanz You may want to look into
diesel_migrationsto run migrations without buildingdiesel_cli.You’re missing the postgres library 😃 I’m not 100% sure, but the
postgresqlorpostgresql-develshould contain what you are looking for.On Wed, 3 Apr 2019, 06:33 Ace Besmonte, notifications@github.com wrote: