New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

diesel - cli "Unable to open the database file" #836

Open
kollapsderwellenfunktion opened this Issue Apr 4, 2017 · 2 comments

Comments

Projects
None yet
3 participants
@kollapsderwellenfunktion

kollapsderwellenfunktion commented Apr 4, 2017

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

@killercup killercup added the bug label Apr 5, 2017

@kollapsderwellenfunktion

This comment has been minimized.

kollapsderwellenfunktion commented Apr 6, 2017

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.

@dreuter

This comment has been minimized.

dreuter commented Apr 8, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment