diesel - cli "Unable to open the database file"

Created on 4 Apr 2017  路  4Comments  路  Source: diesel-rs/diesel

I have a postgres installation (9.5) and was successfully able to connect to it by using the postgres crate. i was also successfully able to use diesel with sqlite. but when i try to use diesel-cli to setup a database i allways get the error "Unable to open the database file".

I'm using

diesel 0.12.0
rustc 1.18.0-nightly (5e122f59b 2017-04-01)
psql (9.5.6)

i tried many combinations to set DATABASE_URL like

echo DATABASE_URL=postgres://planb:*@localhost/planb > .env
diesel setup --database-url postgres://planb:*@localhost/planb

with or without quotes, port etc. tried to switch of ssl on postgres too. postgresql log gives no output.

a simple

let conn = Connection::connect("postgresql://planb:*@localhost", TlsMode::None).unwrap();

using the postgres crate(0.14.0) works without problems

bug

Most helpful comment

Same here...

I ran cargo install --force diesel_cli again and the error disappeared.

Maybe it is worthwhile noting that I installed diesel_cli prior to adding diesel to any Cargo.toml.

I am also running postgres 9.5.5

All 4 comments

i cloned this repository and build redis-cli by myself.(had to deactivate sqlite feature which seems to be broken) and now it works.

i installed the non working version with cargo install diesel_cli

strange. but it now works for me.

Same here...

I ran cargo install --force diesel_cli again and the error disappeared.

Maybe it is worthwhile noting that I installed diesel_cli prior to adding diesel to any Cargo.toml.

I am also running postgres 9.5.5

@sgrif I'm pretty much sure that this issue is stale, maybe it's better to close it?

Yeah, this appears to have been a situation where diesel-cli didn't have the right features enabled. The error message has been improved in that case, and regardless we don't do support on the issues tracker. If anyone feels I've missed an actual bug here, or has a different bug to report, please open a new issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ivan picture ivan  路  4Comments

killercup picture killercup  路  4Comments

ghost picture ghost  路  3Comments

astraw picture astraw  路  4Comments

pwoolcoc picture pwoolcoc  路  3Comments