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" #819

Closed
Gurpartap opened this Issue Mar 22, 2017 · 6 comments

Comments

Projects
None yet
4 participants
@Gurpartap

Gurpartap commented Mar 22, 2017

$ cargo install diesel_cli
   ...
   ...
   Compiling diesel_cli v0.12.0
    Finished release [optimized] target(s) in 68.30 secs
  Installing /Users/Gurpartap/.cargo/bin/diesel
$ ssh -L 5432:localhost:5432 user@db.example.com
$ cd /Users/Gurpartap/Projects/proj
$ echo DATABASE_URL="postgres://user:pass@localhost:5432/dbname?sslmode=disable" > .env
$ ~/.cargo/bin/diesel setup
Creating migrations/ directory at: /Users/Gurpartap/Projects/proj/migrations
Creating database: "postgres://user:pass@localhost:5432/dbname?sslmode=disable"
Unable to open the database file
$ diesel --version
diesel 0.12.0
$ rustc --version
rustc 1.16.0
@Gurpartap

This comment has been minimized.

Gurpartap commented Mar 22, 2017

dotenv crate's issue, perhaps. .env file needs to be

DATABASE_URL=postgres://user:pass@localhost:5432/dbname?sslmode=disable

instead of

DATABASE_URL="postgres://user:pass@localhost:5432/dbname?sslmode=disable"

And now it works.

@Eijebong

This comment has been minimized.

Member

Eijebong commented Mar 22, 2017

@sgrif

This comment has been minimized.

Member

sgrif commented Mar 22, 2017

We probably just need to bump Diesel CLI to use 0.9.0

@Eijebong

This comment has been minimized.

Member

Eijebong commented Mar 22, 2017

#814 :)

@cyplo

This comment has been minimized.

Contributor

cyplo commented Apr 28, 2017

Seems that the dependency got updated, is the problem gone now ? thanks !

@sgrif

This comment has been minimized.

Member

sgrif commented Apr 30, 2017

Yes, the issue should be fixed on master (I don't think we've rolled a release that included it yet)

@sgrif sgrif closed this Apr 30, 2017

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